Path: csiph.com!eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '*not*': 0.07; '*is*': 0.09; 'c/c++': 0.09; 'collections': 0.09; 'implies': 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; 'references,': 0.09; 'value.': 0.15; 'at.': 0.16; 'created.': 0.16; 'distinct': 0.16; 'distinction': 0.16; 'pointer,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:versus': 0.16; 'value;': 0.16; 'pointer': 0.18; 'refers': 0.18; 'variable': 0.18; 'math': 0.20; "aren't": 0.22; 'assign': 0.22; 'c++,': 0.22; "python's": 0.23; 'references': 0.23; "i've": 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'points': 0.27; 'arithmetic': 0.29; 'return;': 0.29; 'program,': 0.29; 'normally': 0.30; "can't": 0.32; 'maybe': 0.33; 'accessible': 0.33; 'received:comcast.net': 0.33; 'running': 0.34; 'but': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'things': 0.38; 'difference': 0.38; 'names': 0.38; 'does': 0.39; 'to:addr:python.org': 0.40; 'term': 0.60; 'skip:u 10': 0.61; 'different': 0.63; 'fundamental': 0.66; 'direct': 0.68; 'skip:\xe2 10': 0.70; 'subjectcharset:utf-8': 0.71; '8bit%:46': 0.76; 'distinguish': 0.84; 'subject::': 0.85 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Random832 Subject: Re: Terminology: =?utf-8?B?4oCccmVmZXJlbmNl4oCd?= versus =?utf-8?B?4oCccG9pbnRlcuKAnQ==?= Date: Sat, 12 Sep 2015 00:42:04 -0400 References: <14afe27e-0bd5-410f-8e64-0f31d496ebf2@googlegroups.com> <55F36B4C.9020007@gmail.com> <1442016698.95299.381478313.2487CA0E@webmail.messagingengine.com> <85mvws6z45.fsf_-_@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: c-68-39-146-59.hsd1.in.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:ggihF8/5O+NRVAuv5hKD381rXcY= 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: 1442032934 news.xs4all.nl 23803 [2001:888:2000:d::a6]:47095 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96397 Ben Finney writes: > With the significant difference that “pointer” implies that it has its > own value accessible directly by the running program, such as a pointer > in C. Its own value *is* what you're accessing when you assign or return it. You just can't do math on it, but there are lots of things you can't do math on. > That's different from a “reference”, which to my understanding implies > the running program does *not* normally have direct access to it as a > distinct value. The only way you can use a reference is to get at the > object to which it refers. In C++, references cannot be reassigned. I consider *that* the fundamental difference - a pointer is a variable that you can reassign and return; a reference always refers to the same object once created. > That's the distinction I've been reying on for years, anyway: Python's > names are references, collections are collections of references, etc. > They aren't pointers because you can't get them as a distinct value; you > can only use them to refer to the object at the other end. Anyway, maybe we do need a term to distinguish Python/C#/Java pointers from C/C++ pointers - maybe call it a "non-arithmetic" pointer, since the key thing about it is you can't do pointer arithmetic on them to get the object "next to" the one it points at.