Path: csiph.com!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'exist,': 0.07; 'objects,': 0.07; '*name*': 0.09; '[1]:': 0.09; 'cached': 0.09; 'dict': 0.09; 'exist.': 0.09; 'files:': 0.09; 'garbage': 0.09; 'here?': 0.09; 'immutable': 0.09; 'integers': 0.09; 'issue:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'python.': 0.11; 'explicitly': 0.15; '*never*': 0.16; 'at.': 0.16; "can't.": 0.16; 'dep': 0.16; 'here).': 0.16; 'labelled': 0.16; 'naming': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:reference': 0.16; 'subject:versus': 0.16; 'wrote:': 0.16; 'obviously': 0.16; 'else,': 0.18; 'instance,': 0.18; 'language': 0.19; '>>>': 0.20; 'people,': 0.20; '2015': 0.20; 'otherwise,': 0.20; "aren't": 0.22; 'disable': 0.22; 'object.': 0.22; 'precise': 0.22; 'sep': 0.22; 'programming': 0.22; 'am,': 0.23; 'defined': 0.23; '(or': 0.23; 'wrote': 0.23; '(you': 0.23; 'represents': 0.23; 'mon,': 0.24; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'header:X -Complaints-To:1': 0.26; 'sense': 0.26; 'chris': 0.26; '14,': 0.27; 'correct': 0.28; 'fine': 0.28; '"do': 0.29; 'question:': 0.29; 'objects': 0.29; 'there.': 0.30; 'anywhere': 0.30; 'code': 0.30; "can't": 0.32; 'generally': 0.32; 'url:python': 0.33; 'common': 0.33; 'accessible': 0.33; 'message-id:@gmail.com': 0.34; 'case,': 0.34; 'skip:d 20': 0.34; 'lists': 0.34; 'list': 0.34; 'exist': 0.35; 'something': 0.35; "isn't": 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'url:org': 0.36; 'created': 0.36; 'possible': 0.36; 'subject:" ': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'being': 0.37; 'agree': 0.37; 'method': 0.37; 'say': 0.37; 'received:org': 0.37; 'wrong': 0.38; 'someone': 0.38; 'mean': 0.38; 'end': 0.39; 'why': 0.39; 'does': 0.39; "didn't": 0.39; 'rather': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'some': 0.40; 'collection': 0.60; 'term': 0.60; 'url:3': 0.60; 'your': 0.60; "they're": 0.66; 'here': 0.66; 'talking': 0.67; 'therefore': 0.67; 'walk': 0.72; 'physical': 0.72; 'received:89': 0.80; '*does': 0.84; 'answer:': 0.84; 'boxes.': 0.84; 'url:reference': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Akira Li <4kir4.1i@gmail.com> Subject: Re: Terminology: "reference" versus "pointer" Date: Mon, 14 Sep 2015 03:30:37 +0300 References: <85mvws6z45.fsf_-_@benfinney.id.au> <85io7g6xy4.fsf@benfinney.id.au> <85egi46wng.fsf@benfinney.id.au> <1a1a1f6a-27ce-4c1b-807a-43eabaa04abb@googlegroups.com> <04ca9d7c-d02b-4329-bd94-4d18d86b3edf@googlegroups.com> <87egi375wb.fsf@gmail.com> <87wpvu5h7f.fsf@gmail.com> <87pp1l6h9a.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Gmane-NNTP-Posting-Host: 89.169.229.68 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:a1cnT6n+zHY/06UvSiBLpnQjykc= 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: 71 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442190730 news.xs4all.nl 23734 [2001:888:2000:d::a6]:35181 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 7941 X-Received-Body-CRC: 1765329843 Xref: csiph.com comp.lang.python:96537 Chris Angelico writes: > On Mon, Sep 14, 2015 at 9:17 AM, Akira Li <4kir4.1i@gmail.com> wrote: >> If you mean this quote from [1]: >> >> Although we commonly refer to "variables" even in Python (because it's >> common terminology), we really mean "names" or "identifiers". In >> Python, "variables" are nametags for values, not labelled boxes. >> >> then *name* is the term that is defined in the Python language >> reference. The word "variable" we can use in day-to-day programming >> _unless_ we are discussing issues that are specific to _naming and >> binding_. In that case, we should use the _exact_ >> terminology. Otherwise there is nothing wrong with using "variables" >> casually in Python. > > Since you're talking about precise terminology, I think it would be > better to say "name binding", rather than "naming and binding". When > you talk of naming something (or someone!), you generally mean that > it's possible to go from the thing to the (canonical) name. With > people, for instance, you can walk up to someone and say "Hi! What's > your name?", but with Python objects, you fundamentally can't. "Naming and binding" is the title from the Python language reference https://docs.python.org/3/reference/executionmodel.html#naming-and-binding Otherwise, I agree with you ("name" is better here). >>> Everything you wrote here has the same issue: The "objects" you are >>> talking about do not physically exist, but are simply the result of >>> calling a method on the object. Therefore they do not *belong* on the >>> diagram, and the diagram not showing them does not mean the diagram is >>> not complete. >> >> "do not physically exist" does not make sense. Objects are *never* >> destroyed explicitly in Python (you can only make them >> *unreachable*). You can disable garbage collection completely and it is >> still will be Python. Immutable objects can be considered immortal e.g.: >> >> (1+1) -- question: does the object that represents int(2) exist before >> the expression is evaluated? >> >> The correct answer: it does not matter: int(2) can be created on the >> fly, a cached int(2) can be reused by a specific implementation -- >> Python doesn't care. >> >> I don't see why the model that can't describe range(1) in Python 3 >> pretends to be complete. > > "Physically" isn't really the right word for it, given that objects in > Python code aren't physical and therefore don't *ever* "physically > exist". My bad there. > > But the objects completely do not exist. Yes, with integers you can't > tell... but what about here? > > dependencies = collections.defaultdict(list) > for fn in files: > for dep in gather_deps(fn): > dependencies[dep].append(fn) > > Until the moment when dependencies[dep] is requested for some new > value of dep, the list *does not exist*. It is constructed anew. > Obviously the end result of this is a dict of lists, and since those > lists aren't accessible from anywhere else, it makes fine sense to > talk about those lists as being "contained within" the (default)dict; > but they clearly didn't exist until they were poked at. They're > Heisenburg's Lists, I guess... lists are _mutable_ in Python.