Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'importing': 0.05; 'that?': 0.05; 'subject:Python': 0.06; 'exists.': 0.07; 'ugly': 0.07; 'implements': 0.09; 'namespace': 0.09; 'runs': 0.10; 'cc:addr :python-list': 0.11; 'python': 0.11; 'programs.': 0.14; '"from': 0.16; '(it': 0.16; '__future__': 0.16; 'exist.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'keyword.': 0.16; 'namespace.': 0.16; 'subject:library': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'feb': 0.22; '>>>': 0.22; 'import': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'module,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'coded': 0.31; 'facility': 0.31; 'keywords,': 0.31; 'this.': 0.32; 'not.': 0.33; 'subject:the': 0.34; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'introducing': 0.36; 'keyword': 0.36; 'turn': 0.37; 'pm,': 0.38; 'does': 0.39; 'called': 0.40; 'new': 0.61; 'simply': 0.61; "you're": 0.61; 'choose': 0.64; '20,': 0.68; 'guaranteed': 0.75; 'introduce': 0.78; "'from'": 0.84; "'with'": 0.84; 'to:none': 0.92 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:cc :content-type; bh=YxDMQt2EGk6ZurDjphsJ9YHqm9L1YH6TXE3Feeglg8s=; b=ruMjoifeq81q9n0gz1K7hVqQMfdU0bsIMmaFBn2A1enEGfIC2B/OLDgOXDpgvM001d 88BY/HDl9spxGnURjIuERsa573tb8KUnxw1nfR4P8ydk1d03ep8kYUmyjI57cEjlhepz UFnA4EEcUp7K83gt4pEh0sYhbYzMOJCaRQNO4fc38EMnqm8LfsvAJRuvAIq0/pLYS0ST dhzFF5g4FCTtMVNRmHRAkQ3YHyIUDyx9XI+RGULTb2PtMgKopmDoO951bGWRGItH5gn2 MCHf4PSI7KUqlRirdF2j/IMGSFp6SFLeW9+Mo6HViVFNPYWTK1BSqifQWDrMFsPveIWG eRHw== MIME-Version: 1.0 X-Received: by 10.66.164.229 with SMTP id yt5mr1438592pab.67.1392896849312; Thu, 20 Feb 2014 03:47:29 -0800 (PST) In-Reply-To: <87eh2y6n1d.fsf@elektro.pacujo.net> References: <87mwhm6q3e.fsf@elektro.pacujo.net> <87eh2y6n1d.fsf@elektro.pacujo.net> Date: Thu, 20 Feb 2014 22:47:29 +1100 Subject: Re: Commonly-used names in the Python standard library From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392896857 news.xs4all.nl 2976 [2001:888:2000:d::a6]:44432 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66749 On Thu, Feb 20, 2014 at 10:28 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Thu, Feb 20, 2014 at 9:22 PM, Marko Rauhamaa wrote: >>> py35.unless x > 7: >>> return >> >> What about return? Are you allowed to namespace that? And 'from' and >> 'import' and '*'? > > Old keywords are guaranteed not to clash with programs. Introducing new > keywords runs that risk. Hence, C had to introduce the ugly _Bool > keyword. Okay, so what you're saying is that there are three states: Before Python X.Y, the unless keyword simply doesn't exist. (It can't be coded in as a module, so it can't exist until someone implements the code.) >From X.Y, it can be called up by importing it from "pyAB" and used in its namespace. >From A.B onward, it always exists. Python has a facility like this. It doesn't namespace the keywords, but it does let you choose whether to have them or not. In Python 2.5, you could type "from __future__ import with_statement" to turn 'with' into a keyword. After Python 2.6, it's always a keyword. ChrisA