Path: csiph.com!goblin1!goblin.stu.neva.ru!uio.no!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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.05; 'think,': 0.05; 'objects,': 0.07; 'variable,': 0.07; 'cc:addr :python-list': 0.09; 'implies': 0.09; 'python': 0.10; 'applies': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.16; 'string': 0.17; 'element': 0.18; 'refers': 0.18; 'programmer': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'preferred': 0.20; '(the': 0.22; "aren't": 0.22; 'assign': 0.22; 'lawrence': 0.22; 'name;': 0.22; 'sep': 0.22; 'trace': 0.22; 'elements': 0.23; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; "i've": 0.25; "doesn't": 0.26; 'message-id:@mail.gmail.com': 0.27; 'object,': 0.27; 'correct': 0.28; 'actual': 0.28; 'objects': 0.29; 'themselves': 0.29; 'another': 0.32; "can't": 0.32; 'reference,': 0.33; 'similar': 0.33; 'add': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'knowledge': 0.35; 'should': 0.36; 'there': 0.36; 'notes': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'say': 0.37; '12,': 0.37; 'associated': 0.38; 'skip:v 20': 0.38; 'names': 0.38; 'stuff': 0.38; 'anything': 0.38; 'mean': 0.38; 'represent': 0.38; 'whatever': 0.39; 'does': 0.39; 'mark': 0.40; 'still': 0.40; 'your': 0.60; 'here.': 0.62; 'more': 0.63; 'different': 0.63; 'to,': 0.63; 'places': 0.64; 'else.': 0.66; 'everybody': 0.67; 'url:v': 0.72; 'url:youtube': 0.73; 'url:watch': 0.78; 'batchelder': 0.84; 'chrisa': 0.84; 'notes,': 0.84; 'to:none': 0.91; 'sheets': 0.91; 'tied': 0.93 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=AS2OGbhdNqJFp1ZIZv01nVQhYBFX3o/etMOUKE8HFqU=; b=Mk93ztRCTQDfXo91AXvkelWo3MmppAC7ghtvsujhxDMICQWWJj51cAkW55lmzuxTne EoNiqwM1/zJX+g4kum9zReFZXKySIjHRjgn78wGvTSVT/OOu0JiVkQwgJCnKwrZv+bPr l8spoB9XPWN6Cs9sOZ/hE/XpHdiW8qyzt6LgkaDgfg1ObsFBjoBcYGrxYGgw13IPd05b OKHL/qDCqYzNyUJDACDZ67jkIrPRtDbKiaI9tr0Kfbx6LKX4JP6d/hW0HXBe7l6V2huu yFOec+tqGyDnoRaFdfY+8+04CNS0DYlq6a/PtS14O2lP/XD4uQ46E9ZIDAtxNtU4Jc4L 154Q== MIME-Version: 1.0 X-Received: by 10.107.41.142 with SMTP id p136mr8438842iop.19.1442038386284; Fri, 11 Sep 2015 23:13:06 -0700 (PDT) In-Reply-To: References: <14afe27e-0bd5-410f-8e64-0f31d496ebf2@googlegroups.com> <55F36B4C.9020007@gmail.com> <1442016698.95299.381478313.2487CA0E@webmail.messagingengine.com> Date: Sat, 12 Sep 2015 16:13:06 +1000 Subject: Re: Python handles globals badly. 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442038394 news.xs4all.nl 23857 [2001:888:2000:d::a6]:34550 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96411 On Sat, Sep 12, 2015 at 3:35 PM, Random832 wrote: > Mark Lawrence writes: >> Let's put it another way, in the 15 years I've been using Python I do >> not recall any experienced Python programmer using "pointer", so what >> makes you think, in 2015, that you are correct and everybody else is >> wrong? I still say that everything in Python is an object, and should >> add that it has one or more things, "names", that are associated with >> it. Hence my preferred analogy about the sticky note. > > So is player3[3] also a name, a sticky note? What if we copy player3 to > another name; does it get two sticky notes, player3[3] and foo[3]? Your > "sticky note" analogy doesn't unify variables/names/whatever you want to > call them with other places that you can assign stuff to, and it implies > that the objects themselves have knowledge of their "names", and that > names are global (if I have two functions each with a result variable, > does that mean there are two different result sticky notes?) Whatever you want to use to describe a name-binding reference, the exact same thing applies to a list element or anything else. If your analogy is strings tied to sheets of paper, with sticky notes on the ends of strings to represent actual names, then you have similar strings connecting list elements to their referents. (The sticky notes aren't actually part of the objects, and you just have to understand that you can't trace a string "backwards", only "forwards"; there's no way to start with an object and ask "what refers to this?".) Here. Ned Batchelder explains it better than I can. http://nedbatchelder.com/text/names1.html https://www.youtube.com/watch?v=_AEJHKGk9ns ChrisA