Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'javascript,': 0.07; 'method.': 0.07; 'variables': 0.07; 'beginners': 0.09; 'method,': 0.09; 'ruby,': 0.09; '~ethan~': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'change;': 0.16; 'confuse': 0.16; 'immutable,': 0.16; 'lisp,': 0.16; 'subject:class': 0.16; 'variable.': 0.16; 'variables,': 0.16; 'variables:': 0.16; 'java,': 0.16; 'language': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'do.': 0.18; 'variable': 0.18; "python's": 0.19; 'meant': 0.20; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'simpler': 0.24; 'visible': 0.24; 'regardless': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 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; 'languages': 0.32; 'blog:': 0.33; 'programmers': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'subject:]': 0.38; 'pm,': 0.38; 'does': 0.39; 'enough': 0.39; 'dave': 0.60; 'referred': 0.60; 'course': 0.61; "you're": 0.61; 'name': 0.63; 'refer': 0.63; 'box,': 0.64; 'more': 0.64; 'different': 0.65; 'within': 0.65; 'fact,': 0.69; 'details:': 0.80; 'batchelder': 0.84; 'ethan': 0.84; 'furman': 0.84; 'partially': 0.84; 'angel': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=gZksNxOK5019yXONf5IPZOzUOu+/cDyXVQAJv3P7ddg=; b=qyVwAdvqcDT6v01Wd0KN32ONsd+4phLu0A6lscDtNPjLIrtbD3VwmHvLe6u5drUkRK nps8x8BZSx0hxsAQtiFPmt5jlRnG9oBjqUySpzJmavByE/FhaZOv55itA644TGR0Av1Q wOMXYCDFFf+MdK44OZH9G4tXMSEm2DdqaEVl2hM/35K2IoiOeh1qK3WLzoVO5rgnPSvx ALu2yC+5INVYBQ2I5oucljgSGBd/Gj3CSZ+xJVNIIHS/R2bFQvoA7eqVVBZYFQJKS/QW atgGrDBje+ejx8XChTO6yE9XhpMUIsgVx+uxFA4pWZtxyDurYZsvQcDb+P29bjFgsf2o fFFw== X-Received: by 10.49.6.232 with SMTP id e8mr31993896qea.18.1380584708226; Mon, 30 Sep 2013 16:45:08 -0700 (PDT) Sender: Ned Batchelder Date: Mon, 30 Sep 2013 19:45:06 -0400 From: Ned Batchelder User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Ethan Furman Subject: Re: 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> <5249F4EE.60604@stoneleaf.us> In-Reply-To: <5249F4EE.60604@stoneleaf.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org 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: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380584711 news.xs4all.nl 15964 [2001:888:2000:d::a6]:57860 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:55141 On 9/30/13 6:02 PM, Ethan Furman wrote: > 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. > It might help C programmers to stay away from "variable," but some people claim we should avoid the word so as not to confuse beginners. That's just silly. Beginners have no holdover concepts from C. Lots of languages use the same names and values model that Python does: Javascript, Java, Ruby, Lisp, etc. > 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? Yes, I meant that 1) names refer to values, and 2) a name can refer to different values over the course of a program. Hence, the value varies, hence, a variable. In fact, it's more accurate to say that Python has no constants! :) --Ned. > > -- > ~Ethan~