Path: csiph.com!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; '(python': 0.05; 'none,': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'languages.': 0.15; 'object()': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:class': 0.16; 'subject:variable': 0.16; 'syntaxerror:': 0.16; 'language': 0.19; '>>>': 0.20; '"",': 0.22; 'assign': 0.22; 'constant': 0.22; 'defined': 0.23; 'seems': 0.23; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'question': 0.27; 'becomes': 0.30; "can't": 0.32; 'maybe': 0.33; 'file': 0.34; 'false': 0.35; 'keyword': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'names': 0.38; 'anything': 0.38; 'does': 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'term': 0.60; 'avoid': 0.61; 'making': 0.62; 'deals': 0.67; 'skip:\xe2 10': 0.70; 'subjectcharset:utf-8': 0.71; '8bit%:40': 0.72; 'subject:have': 0.80; '_o__)': 0.84; 'received:125': 0.84; 'dennis': 0.91; 'louis': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: What does it mean for Python to have =?utf-8?B?4oCcY29uc3RhbnRz?= =?utf-8?B?4oCdPw==?= (was: variable scope of class objects) Date: Wed, 21 Oct 2015 11:27:51 +1100 References: <9ocd2btlkq7kp3margtn4sj3mehd7bpimm@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:qIRfdk9MgDSsZSGEPMbR0mIMb4s= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1445387285 news.xs4all.nl 23811 [2001:888:2000:d::a6]:43957 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:97850 Dennis Lee Bieber writes: > (Python does not have anything that one might consider a true constant > -- other than the language defined singletons: None, and maybe by now > True and False). Python now deals with those by making the names keywords:: >>> True = object() File "", line 1 SyntaxError: can't assign to keyword >>> False = object() File "", line 1 SyntaxError: can't assign to keyword >>> None = object() File "", line 1 SyntaxError: can't assign to keyword which seems to rather avoid the question of whether they are “constants” as would be understood by newcomers experienced with that term in other languages. -- \ “Crime is contagious… if the government becomes a lawbreaker, | `\ it breeds contempt for the law.” —Justice Louis Brandeis | _o__) | Ben Finney