Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'heavily': 0.04; 'explicitly': 0.05; 'interpreter': 0.05; 'root': 0.05; 'startup': 0.05; 'abstain': 0.09; 'anticipate': 0.09; 'builtin': 0.09; 'forcing': 0.09; 'global,': 0.09; 'namespace': 0.09; 'objects,': 0.09; 'received:mail-vc0-f174.google.com': 0.09; 'seemed': 0.09; 'whatever.': 0.09; 'cc:addr:python-list': 0.11; 'contribute': 0.11; 'python': 0.11; '"in': 0.16; 'builtins': 0.16; 'dict': 0.16; 'file"': 0.16; 'identifiers': 0.16; 'imports': 0.16; 'name",': 0.16; 'namespace,': 0.16; 'qualified.': 0.16; 'readability': 0.16; 'scope.': 0.16; 'tuple,': 0.16; 'looked': 0.18; 'variable': 0.18; 'trying': 0.19; "python's": 0.19; 'seems': 0.21; '(the': 0.22; 'import': 0.22; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'load': 0.23; 'string,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; "i've": 0.25; 'right.': 0.26; 'pass': 0.26; 'skip:_ 20': 0.27; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; '(like': 0.30; 'message-id:@mail.gmail.com': 0.30; 'included': 0.31; 'code': 0.31; 'argue': 0.31; 'int,': 0.31; 'names.': 0.31; 'received:209.85.220.174': 0.31; 'file': 0.32; 'themselves': 0.32; 'guess': 0.33; 'level.': 0.33; 'could': 0.34; 'received:209.85': 0.35; 'classes': 0.35; 'received:209.85.220': 0.35; 'etc.)': 0.35; 'objects': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'keyword': 0.36; 'should': 0.36; 'too': 0.37; 'received:209': 0.37; 'step': 0.37; 'issue': 0.38; 'list,': 0.38; 'that,': 0.38; 'anything': 0.39; 'environment.': 0.39; 'space': 0.40; 'up,': 0.60; 'simply': 0.61; 'name': 0.63; 'personal': 0.63; 'such': 0.63; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'default': 0.69; 'commenting': 0.84; 'understand,': 0.84; 'subject:Don': 0.91; 'imagine': 0.93; 'washington': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9jOsaRaO6wUrlNHzynKpeNCz40E+oLrYXI9bdhxxIQ0=; b=XUVpoQ2kBabm4lQUxYItNsD4/n/ufjUGiYC05RwAljCsh91qzTOq6NAG1P4Nz2LlXA mWcnio7tXKPzFZXypQ88yfN1d6Xh2ckNddywYpkEWdpW2plIHAAfsN4QKVqYUmHqpOTH cQKmGVP7hqCC2iobYDetAtM81GE7T7uKHneQNdo3UhYIkKl5/5tZsKbA+3IdZgfkurIc Itmg+uK4t+rp+f4p8d3Te8MutjV836yUgd5mG2P3mFrQ3fkslYsTr3/SrogGLTvMt3Pj 95otpySMoeNuXIbnNEZ9GDpV6OBCmREqjngRH+OJVsD5qjVIpvWhSit55XNpKjaIptvw 7aIw== MIME-Version: 1.0 X-Received: by 10.220.112.16 with SMTP id u16mr10698481vcp.40.1371083204063; Wed, 12 Jun 2013 17:26:44 -0700 (PDT) In-Reply-To: References: Date: Wed, 12 Jun 2013 17:26:43 -0700 Subject: Re: "Don't rebind built-in names*" - it confuses readers From: Mark Janssen To: Chris Angelico Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371083212 news.xs4all.nl 15896 [2001:888:2000:d::a6]:46681 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47870 > The builtins don't need to be imported, but they're identifiers like > anything else. They're a namespace that gets searched after > module-globals. Yes, I understand, though for clarity and separability, it seems that having them in a namespace that gets explicitly pulled into the global space is less messy, despite the extra step (the default python distribution could include a STARTUP file that imports the builtin types). But I must withhold my personal philosophy lest it get too complicated. >> And int, list, tuple, dict and such always seemed >> like keywords to my CS self because they were included in Python's >> type system (like "int" would be in C). > > Yep, but in Python, types/classes are themselves objects, so you can > pass them around like anything else. This also downgrades them from > "language keyword" to "always-available name", which in effect > upgrades your _own_ classes to the same level. Yes, and here is where I've been trying to argue that Python's object model isn't right. But I must abstain from commenting further. >> They are all one-step removed from keywords. And yet, since they are >> not in a separate namespace, they should not be used as variable >> names. Perhaps since they are very different from one another, they >> should be put in separate namespaces off of a global, root >> namespace... (math, string, etc.) > > There's no point forcing them to be looked up in a two-step process. > If you want that, you can simply reference them as > __builtins__.whatever, but you can instead just reference them as the > unadorned name whatever. They contribute heavily to the simplicity and > readability of Python code - imagine if every call to len() had to be > qualified. Well I would anticipate a keyword ("load"?) so one could load a particular namespace into the global scope. The issue I guess is when should modules be "on file" vs. "in memory" like the builtins? The reason this is coming up, is because I would like to imagine a data ecosystem, where I can import a set of objects from the network as if they are local right into my interpreter environment. -- MarkJ Tacoma, Washington