Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; '(at': 0.04; 'languages,': 0.04; 'languages.': 0.04; 'model,': 0.05; 'say,': 0.05; 'subject:Python': 0.06; 'correct.': 0.07; 'explicit': 0.07; 'javascript,': 0.07; 'variables': 0.07; 'bindings': 0.09; 'false,': 0.09; 'high-level': 0.09; 'integers': 0.09; 'meaningful': 0.09; 'objects,': 0.09; 'php,': 0.09; 'ruby,': 0.09; '\xe2\x80\x94': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'wrote': 0.14; 'mostly': 0.14; '"python': 0.16; '(there': 0.16; 'assigned,': 0.16; 'comparison.': 0.16; 'declared': 0.16; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'reality:': 0.16; 'semantics': 0.16; 'utterly': 0.16; 'variables,': 0.16; 'wrongly': 0.16; 'java,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; "python's": 0.19; 'seems': 0.21; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'copied': 0.24; 'java': 0.24; 'question': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'compare': 0.26; 'pass': 0.26; 'least': 0.26; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'important.': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'argue': 0.31; "d'aprano": 0.31; 'follows': 0.31; 'implied': 0.31; 'steven': 0.31; 'unique,': 0.31; 'anyone': 0.31; 'there.': 0.32; 'languages': 0.32; 'cases': 0.33; 'fri,': 0.33; 'comment': 0.34; 'maybe': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'impression': 0.36; 'programming,': 0.36; 'useful': 0.36; 'expected': 0.38; 'ben': 0.38; 'somebody': 0.38; 'does': 0.39; 'sure': 0.39; 'enough': 0.39; 'called': 0.40; 'how': 0.40; 'even': 0.60; 'eventually': 0.60; 'most': 0.60; 'strictly': 0.61; 'first': 0.61; 'back': 0.62; 'term': 0.63; 'subject:The': 0.64; 'more': 0.64; 'different': 0.65; 'skip:\xe2 10': 0.65; 'world': 0.66; 'optimized': 0.68; 'containing': 0.69; 'overall': 0.69; 'subjectcharset:utf-8': 0.72; '8bit%:43': 0.74; 'subject:have': 0.80; 'truth': 0.81; "'object'": 0.84; 'around,': 0.84; 'confusing': 0.84; 'discussions,': 0.84; 'recently:': 0.84; 'shock': 0.84; 'to:none': 0.92 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:content-transfer-encoding; bh=bdbxz8BUjVoMiq4JT6ZuHxXzTHnFue5NjQMmkb76Riw=; b=ksnHiSsvESoWjS5t7Al0MqULYuLpAOZSXjnvEyEywwCieYkvtImGyjw0tgn5oIo2Tx S0CxOAbjS8e7E1sZyObPwpJOz14qaHFel6TYYSGSTZKvHqT7RJwcB+oAS3g66vi1FpCS qcPSdDNWjMGIbbDFu5xFpLzUOEpEv8vU5pYJ9xXVGYqGD42I8PE7EvyBoGcJf+R408VM S7IrkLw5jF3ZgqdoZKSh+IECmLGJu07s8tn5MDSHfZFOuLUIsp5VtbZUEwJmspCrjzxb AzwlztPhHaVt8FKq/T03etntiV2czT4cEbcmomcRzDPZSX2pGfpXvS7ocHJUpd/exbVX SQ/Q== MIME-Version: 1.0 X-Received: by 10.220.133.197 with SMTP id g5mr3321803vct.20.1399560661756; Thu, 08 May 2014 07:51:01 -0700 (PDT) In-Reply-To: <536b9308$0$29965$c3e8da3$5496439d@news.astraweb.com> References: <235C4BFA-9770-481A-9FCF-21C3F036769C@gmail.com> <5368681D.8070602@islandtraining.com> <85zjiuea37.fsf_-_@benfinney.id.au> <8738gmxgay.fsf@elektro.pacujo.net> <87tx91warf.fsf@elektro.pacujo.net> <85eh05cdjx.fsf@benfinney.id.au> <87ha50hagu.fsf@elektro.pacujo.net> <536b8411$0$29965$c3e8da3$5496439d@news.astraweb.com> <536b9308$0$29965$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 9 May 2014 00:51:01 +1000 Subject: =?UTF-8?B?UmU6IFRoZSDigJxkb2VzIFB5dGhvbiBoYXZlIHZhcmlhYmxlcz/igJ0gZGViYXRl?= From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 66 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399560664 news.xs4all.nl 2911 [2001:888:2000:d::a6]:56540 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71109 On Fri, May 9, 2014 at 12:22 AM, Steven D'Aprano wrote: >> Maybe the shock value is helpful, but that doesn't mean the statement's >> strictly correct. It seems that every time we have one of these >> discussions, someone claims that Python's name->object bindings are >> utterly unique in the world of programming, > > I'm pretty sure I've never seen anyone make that claim explicitly. I'm > not even sure anyone has implied it, although I have seen people counter > the "no variables" meme with the *accusation* that the meme wrongly makes > Python out to be radically different from other programming languages. > > I think there is a kernel of truth to that accusation. I know that when I > was first exposed to this meme, I got the impression that Python was, if > not unique, at least rare. Eventually somebody challenged that meme by > pointing out that Ruby, Javascript and Java use the same model, and that > it is pretty much standard for high-level languages. > > >> which is patently false, as >> a number of other languages do the same thing (often calling them >> variables). So what does "Python doesn't have variables" mean? Really >> it's "Python doesn't have variables like C's or Pascal's". > > Which is what both Ben and I *explicitly* say, when we use this meme. You might, but he didn't. Compare what he wrote recently: On Wed, May 7, 2014 at 9:55 AM, Ben Finney wrote: > I don't know enough Ruby to comment there. For Java, Javascript, PHP, > they *do* have variables that work pretty much as expected by these > newcomers: the variables are declared and exist before a value is > assigned, they have the =E2=80=9Cbox containing a value=E2=80=9D conceptu= al model (as > contrasted with Python's =E2=80=9Cvalue with sticky-notes attached=E2=80= =9D model), the > =E2=80=9Chow do I pass by reference or by value?=E2=80=9D question is mea= ningful =E2=80=94 all > of these are significantly different in Python, so the term =E2=80=9Cvari= able=E2=80=9D > is useful in those other languages but mostly just a confusing obstacle > in learning Python. Implication: That Java, JavaScript, and PHP, with Ruby as the only omission, all have C/Pascal variables, and Python doesn't. Reality: Java and JavaScript follow Python-like semantics (at least as regards boxed objects, in the case of the former; unboxed integers in Java are more akin to C's integers), and PHP is... well, PHP is PHP, I don't think there's really much comparison. But even in PHP, the 'object' type more-or-less follows Python-like semantics. (There are some extreme weirdnesses as regards arrays, which are notionally copied whenever they're passed around, but it seems in most cases to be optimized to copy-on-write. I'm not sure what happens when you use a PHP reference. So I'm just going back to "PHP is PHP".) Since Ruby also follows Python-like semantics, as do Pike, and (IIUC) C#, and many other languages, the overall result is that Python is far from unique, and that the explicit "like C's or Pascal's" is important. And then the question becomes: How useful is it to argue that "Python doesn't have variables like C's or Pascal's" to someone who has never used C or Pascal? And if that person has experience with JavaScript's variables, is it as counterproductive to say "Python doesn't have variables" as to watch the Ruby people argue that it's really called pass-by-reference? ChrisA