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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'cpython': 0.05; 'memory.': 0.05; 'bits': 0.07; 'objects,': 0.07; 'pypy': 0.07; 'cc:addr :python-list': 0.09; 'bits.': 0.09; 'pointers': 0.09; 'python': 0.10; 'value.': 0.15; '"well,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:reference': 0.16; 'subject:versus': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'integer': 0.18; 'language': 0.19; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'java': 0.22; 'constant': 0.22; 'maintains': 0.22; 'object.': 0.22; 'sep': 0.22; 'am,': 0.23; 'implemented': 0.24; 'thus': 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'separate': 0.27; 'message-id:@mail.gmail.com': 0.27; 'locations': 0.27; '13,': 0.29; 'objects': 0.29; 'fixed': 0.31; 'screen': 0.32; 'url:python': 0.33; 'editor': 0.34; 'received:google.com': 0.35; 'text': 0.35; 'url:org': 0.36; 'subject:" ': 0.36; 'url:library': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'things': 0.38; 'does': 0.39; 'some': 0.40; 'url:3': 0.60; 'press': 0.61; 'address': 0.61; 'black': 0.61; 'skip:n 10': 0.62; 'guaranteed': 0.67; 'black,': 0.84; 'chrisa': 0.84; 'flipping': 0.84; 'identities,': 0.84; 'url:functions': 0.84; 'white,': 0.84; 'to:none': 0.91 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=mZPcxHRY1ExJNTgbdPpJK0owqbHECBFF/lUkP6Ug3Z4=; b=KF5W9c59jUkHwtTc2RX4hDv4icMVfGW2BVkC5yRUL43l1c9SmgIaWCwtlocNJaLiVx h/Z0PuQllYbM1m0uglN2DSVv4A20WSyNNGZZ6cKLgYtV8aI9vJcT1H81HiDCTIz9wKsB D+Bqo+NirzFI6EapcrjRLMqkgWa9UhEdfM0rEQ3d4k73EorwKM9QsKxDBJSaNAxBSu8Q /uMvIFrokwsHQ0xc/TS7KevOBEW877my2P17/FSDSIYny5OO88AqercbEZsN7IzUDgXL /kPy/4b4KQjWYHqRNAY8rVTRZES82i2TbVrM1PYsy3fDNFf9//9cD+LV9hazHjiKJHFP Mmlw== MIME-Version: 1.0 X-Received: by 10.107.41.142 with SMTP id p136mr11466716iop.19.1442077588339; Sat, 12 Sep 2015 10:06:28 -0700 (PDT) In-Reply-To: <1dabdb08-2aee-4a53-bb57-1410edd372f6@googlegroups.com> References: <14afe27e-0bd5-410f-8e64-0f31d496ebf2@googlegroups.com> <55F36B4C.9020007@gmail.com> <1442016698.95299.381478313.2487CA0E@webmail.messagingengine.com> <85mvws6z45.fsf_-_@benfinney.id.au> <55f45396$0$1660$c3e8da3$5496439d@news.astraweb.com> <1dabdb08-2aee-4a53-bb57-1410edd372f6@googlegroups.com> Date: Sun, 13 Sep 2015 03:06:28 +1000 Subject: Re: Terminology: "reference" versus "pointer" 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.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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442077597 news.xs4all.nl 23867 [2001:888:2000:d::a6]:49577 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96433 On Sun, Sep 13, 2015 at 2:54 AM, Rustom Mody wrote: >> Insisting that Python has pointers is like insisting that you use a text >> editor by flipping bits. "What happens if I press Ctrl-X?" "Well, these >> bits on the screen flip from black to white, these bits flip from white to >> black, and these stay the same." >> > > This is from the docs > https://docs.python.org/3/library/functions.html#id > > id(object) > > Return the "identity" of an object. This is an integer which is guaranteed to be unique and constant for this object during its lifetime. Two objects with non-overlapping lifetimes may have the same id() value. > > CPython implementation detail: This is the address of the object in memory. *Python* does not have addresses. *CPython* is an implementation of the Python language which uses memory. Jython uses Java objects, and thus doesn't have memory addresses. PyPy doesn't keep things at fixed locations in memory, and maintains a separate concept of object identities, even though it is implemented using some form of system memory. Python does not have pointers or addresses. ChrisA