Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'method.': 0.07; 'variables': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'method,': 0.09; '~ethan~': 0.09; 'python': 0.11; 'change;': 0.16; 'immutable,': 0.16; 'subject:class': 0.16; 'variables,': 0.16; 'variables:': 0.16; 'language': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'variable': 0.18; "python's": 0.19; 'meant': 0.20; 'header:User-Agent:1': 0.23; 'simpler': 0.24; 'visible': 0.24; 'regardless': 0.24; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'points': 0.29; "doesn't": 0.30; 'label': 0.30; 'usually': 0.31; 'subject:skip:i 10': 0.31; 'class': 0.32; 'blog:': 0.33; 'but': 0.35; 'subject:]': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'dave': 0.60; 'referred': 0.60; 'received:173': 0.61; 'course': 0.61; "you're": 0.61; 'name': 0.63; 'refer': 0.63; 'box,': 0.64; 'different': 0.65; 'within': 0.65; 'details:': 0.80; 'batchelder': 0.84; 'partially': 0.84; 'angel': 0.91 Date: Mon, 30 Sep 2013 15:02:22 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Python variables? [was Re: class implementation] References: <6e338858-b9e6-4745-9959-35d7c0c7724e@googlegroups.com> <02724244-c924-4cf0-9656-71ade6e435c2@googlegroups.com> <5249ECFE.2050402@nedbatchelder.com> In-Reply-To: <5249ECFE.2050402@nedbatchelder.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3304.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:53658 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380580012 news.xs4all.nl 15963 [2001:888:2000:d::a6]:45589 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:55130 On 09/30/2013 02:28 PM, Ned Batchelder wrote: > On 9/30/13 3:34 PM, Dave Angel wrote: >> Python doesn't actually have variables, but the things it documents as >> variables are local names within a method. Those are not visible >> outside of the method, regardless of whether you're in a class or a >> subclass. > > Why does this meme persist!? Of course Python has variables, they just don't work like C variables do. If you'd like > to know the details: http://nedbatchelder.com/text/names.html Because Python's model is different enough that it usually makes thinking about it simpler to stay away from the word 'variable'; in every other language I have used a variable is a box, but in Python it's a label for a box. From your blog: > > Names are Python's variables: they refer to values, and > those values can change (vary) over the course of your > program. This is partially incorrect. If the value referred to by the name is immutable, then it cannot change; perhaps you meant to say that which object the name points to can vary over time? -- ~Ethan~