Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'violates': 0.09; 'python': 0.11; 'random': 0.14; "wouldn't": 0.14; 'changes': 0.15; '201': 0.16; 'behavior:': 0.16; 'certainly.': 0.16; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'violated': 0.16; 'demonstrate': 0.16; 'language': 0.16; 'obviously': 0.18; 'value.': 0.19; '>>>': 0.22; 'saying': 0.22; 'header:User-Agent:1': 0.23; 'integer': 0.24; 'earlier': 0.24; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; 'returned': 0.30; 'wright': 0.31; 'writes:': 0.31; 'yes.': 0.31; 'url:python': 0.33; 'could': 0.34; 'created': 0.35; 'test': 0.35; 'but': 0.35; 'there': 0.35; 'object,': 0.36; 'received:com.au': 0.36; 'representing': 0.36; 'url:org': 0.36; 'example,': 0.37; 'implement': 0.38; 'ben': 0.38; 'to:addr:python- list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'how': 0.40; 'read': 0.60; 'above,': 0.60; 'url:3': 0.61; "you're": 0.61; 'times': 0.62; 'different': 0.65; 'skip:\xe2 10': 0.65; 'compliant': 0.68; 'invalid': 0.68; '8bit%:46': 0.78; 'received:125': 0.84; 'url:datamodel': 0.84; 'url:reference': 0.84; 'watched': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Reference Date: Thu, 06 Mar 2014 08:07:25 +1100 References: <53144e8d$0$2149$426a74cc@news.free.fr> <1d1dfa1b-b715-4d8f-9c12-f0d3dc1a22c9@googlegroups.com> <85ppm3httu.fsf@benfinney.id.au> <20140303155112.46e34ff8@bigbox.christie.dr> <87siqy7whs.fsf@elektro.pacujo.net> <53155c15$0$2923$c3e8da3$76491128@news.astraweb.com> <164d209c-ba5e-449f-bc25-c27ebfb1fc0f@googlegroups.com> <5316b0dc$0$2923$c3e8da3$76491128@news.astraweb.com> <55d6a455-1856-4fd6-ac4b-c277ff7e2bd1@googlegroups.com> <53176aac$0$29985$c3e8da3$5496439d@news.astraweb.com> <87r46g75t9.fsf@elektro.pacujo.net> <87iors74re.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: vmx15867.hosting24.com.au X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:SL+NTunrbEK7neVEpdVJaTQT6nM= 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1394053659 news.xs4all.nl 2893 [2001:888:2000:d::a6]:57673 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67878 Marko Rauhamaa writes: > Say I implement Python. Say I returned a random number for id(), how > would that violate the language spec? You could do that, certainly. So long as that randomly-chosen integer was always the same for every object, and never the same for any other concurrently-existing object, it can just as well be assigned randomly. If you're saying that your implementation of ‘id(foo)’ would return a *different* integer when called at different times for the same object, then yes, that violates the specification for that function. > It would violate the spec. But there would have to be a paragraph in > the specification that was violated or a reference test case that > failed. Yes. It would violate this paragraph: Every object has an identity, a type and a value. An object’s identity never changes once it has been created […] the id() function returns an integer representing its identity. Again, I ask you to read these documents for comprehension. > For example, this test would demonstrate obviously invalid behavior: > > >>> print(id(x)) > 129 > >>> print(id(x)) > 201 Yes. That violates the paragraph above, and so that implementation is not compliant with the Python language reference. -- \ “I watched the Indy 500, and I was thinking that if they left | `\ earlier they wouldn't have to go so fast.” —Steven Wright | _o__) | Ben Finney