Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Object identity has no necessary connection to memory location (was: What is a function parameter =[] for?) Date: Thu, 26 Nov 2015 22:24:25 +1100 Lines: 34 Message-ID: References: <56550273$0$1585$c3e8da3$5496439d@news.astraweb.com> <5655f27b$0$1614$c3e8da3$5496439d@news.astraweb.com> <6imd5b9it55sucrcl95o95tppro7errfsi@4ax.com> <871tbdf2o0.fsf@elektro.pacujo.net> <70qd5b9lbtjlsotn7d21gor4rd67o79ou7@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de 9tsJG6BaYEco+HELxq90BQNpxhsHcBG6QjsYbnjuuO6w== Cancel-Lock: sha1:CzQ4hMG+mMmF2yKdG75NYrQJ0Qc= 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; 'pypy': 0.07; 'exiting': 0.09; 'pointers': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Object': 0.09; 'stored': 0.10; 'python': 0.10; 'explicitly': 0.15; 'value.': 0.15; 'assumptions': 0.16; 'at.': 0.16; 'presume': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:?)': 0.16; 'unwarranted': 0.16; "variable's": 0.16; 'wrote:': 0.16; 'translation': 0.16; 'memory': 0.17; 'numerical': 0.18; 'language': 0.19; 'location,': 0.22; 'appears': 0.23; 'seems': 0.23; 'unlike': 0.23; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'figure': 0.27; "i'm": 0.30; 'connection': 0.30; "can't": 0.32; 'statement': 0.32; 'getting': 0.33; 'surprised': 0.33; 'i.e.': 0.35; 'identity': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'detail': 0.38; 'why': 0.39; 'to:addr:python.org': 0.40; 'skip:u 10': 0.61; 'promise': 0.66; 'skip:\xe2 10': 0.70; '_o__)': 0.84; 'farrance': 0.84; 'received:125': 0.84; 'subject:location': 0.84; 'subject:necessary': 0.84; 'belief': 0.91; 'promised': 0.91; 'shares': 0.93 X-Injected-Via-Gmane: http://gmane.org/ 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) 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: , Xref: csiph.com comp.lang.python:99558 Dave Farrance writes: > Marko Rauhamaa wrote: > > >Dave Farrance : > > > >> (Conversely, I see that unlike CPython, all PyPy's numbers have > >> unchanging ids, even after exiting PyPy and restarting, so it seems > >> that PyPy's numerical ids are "faked".) > > > >What's a faked id? > > You can figure out what I'm getting at -- i.e. I presume that the ids > are not pointers to stored numbers in memory (as with CPython) but are > a translation of the numerical variable's value. Why refer to that as “faked”? That's what I can't figure out about what you're getting at. Perhaps Marko shares my uncomprehension. The Python language makes no promise about “pointers to stored numbers in memory” for object identity. That is an implementation detail of CPython, and is *explicitly* not promised for any other Python implementation. If you are surprised that object identity appears to have no connection with memory location, then you've made unwarranted assumptions that are explicitly warned against in the Python documentation. -- \ “Absurdity, n. A statement or belief manifestly inconsistent | `\ with one's own opinion.” —Ambrose Bierce, _The Devil's | _o__) Dictionary_, 1906 | Ben Finney