Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.06; 'variables': 0.07; 'bindings': 0.09; 'key.': 0.09; 'objects,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'dict': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'key/value': 0.16; 'pairs,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'passing': 0.19; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'cc:2**0': 0.24; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'code': 0.31; 'that.': 0.31; 'anyone': 0.31; 'class': 0.32; 'implemented': 0.33; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'being': 0.38; 'pm,': 0.38; 'expect': 0.39; 'even': 0.60; 'name': 0.63; 'such': 0.63; 'subject:The': 0.64; 'subjectcharset:utf-8': 0.72; 'subject:have': 0.80; 'actually,': 0.84; 'ethan': 0.84; 'furman': 0.84; 'of*': 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; bh=FZCYsCPAtHSzuim9VM0tHv57BjUcrVd9YGU4yDxbHlM=; b=nX4YxFZXTk4ECjBMW/rZ5sey0nrByIAksGNzTT6Mz70sWgjBBgJwQzrd8qqtLHtkA6 Q+u5ZlM1ELer1ygrdkw3cf11312lUAV58Y66lcyU80eF6XpyDuWqUhSVKEskOVV4mCWq Ptg4NPU2Gx90w76UBsUhHX1GqWQl2L9m2KboTO5deqU/idWNEMQvTu0wcEo7xaHuJjS/ y2X6NCozB8Iz84sVEJapaLvS6EaaGP5VPN9ZcoI1oYvW60cteoe8HHMzzC48zeVz0XhE q1w+ODAPnhcM0Uh6J8S/N2eeTK2uVxApkfPJtPUHcgpGIJv/0KWQTuKA32n7E1KgDBi7 4dEw== MIME-Version: 1.0 X-Received: by 10.58.39.129 with SMTP id p1mr888346vek.69.1399472067855; Wed, 07 May 2014 07:14:27 -0700 (PDT) In-Reply-To: <536A2E73.5030106@stoneleaf.us> References: <235C4BFA-9770-481A-9FCF-21C3F036769C@gmail.com> <5368681D.8070602@islandtraining.com> <85zjiuea37.fsf_-_@benfinney.id.au> <8738gmxgay.fsf@elektro.pacujo.net> <536A2E73.5030106@stoneleaf.us> Date: Thu, 8 May 2014 00:14:27 +1000 Subject: =?UTF-8?B?UmU6IFRoZSDigJxkb2VzIFB5dGhvbiBoYXZlIHZhcmlhYmxlcz/igJ0gZGViYXRl?= 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.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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399472070 news.xs4all.nl 2892 [2001:888:2000:d::a6]:60822 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71021 On Wed, May 7, 2014 at 11:00 PM, Ethan Furman wrote: > On 05/06/2014 11:18 PM, Marko Rauhamaa wrote: >> >> Actually, while Python variables are not first-class objects, one could >> see them as dictionary-key pairs. So you can even pass them by reference >> by passing the dictionary and the key. > > > Well, you could pass them that way, but not necessarily change them: > [ chomp demo code using locals() ] That's because, while you can *think of* Python name bindings as being like dict key/value pairs, they aren't always that. Function locals, class locals, and other such namespaces aren't necessarily implemented with dicts. They're conceptually still a "dictionary" of sorts, but you can't actually pass anyone a dict and key and expect it to work. ChrisA