Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.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.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:Python': 0.06; 'interpreter.': 0.07; 'variables': 0.07; 'cc:addr:python-list': 0.11; 'changes': 0.15; 'dict': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'weird.': 0.16; 'wrote:': 0.18; 'module': 0.19; 'thu,': 0.19; 'work,': 0.20; 'tests': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; '(including': 0.33; 'url:python': 0.33; 'actual': 0.34; 'test': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'should': 0.36; 'level': 0.37; 'mine': 0.38; 'url:library': 0.38; 'free': 0.61; 'affect': 0.61; 'subject:The': 0.64; 'different': 0.65; 'note:': 0.66; 'subjectcharset:utf-8': 0.72; 'subject:have': 0.80; 'returns.': 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=b4OoVCOgptAW0ZTRn+fpSbnJrEy8mYavz7VFDgl1qjI=; b=gQ0830hZsJ9Gx8kVNQMvNWmWH+4FpMbZNpHfGbJiFITnVd72J+KrYx6aelT9JsNr9b 9mOivJiPj+9GRlzJDUoEJEuIycznm+XHOyuwgxxh4h0gMiBxiPbK5YdCmN37t0sEzJfB +svXxSngjObfii0fDt+LXjy+af50Of9E2FjAMRrzpw32LflOLGX12rcmh75mjpJRBwaX f6hZv7m/7yf6KJk5dskX5WkAbGDcXX11vcUyOYOvlwEoyhvVqEZjJV2sajXEv/CdWiMG 8xE6HOsguRSS6TDL9OGOXHcQqUHdhnQEDMrFEbsbIhjcly2U1COA2pD00CfeJP5On+ul 5ksw== MIME-Version: 1.0 X-Received: by 10.58.200.227 with SMTP id jv3mr540396vec.77.1399473029246; Wed, 07 May 2014 07:30:29 -0700 (PDT) In-Reply-To: <87r445hdvw.fsf@elektro.pacujo.net> References: <235C4BFA-9770-481A-9FCF-21C3F036769C@gmail.com> <5368681D.8070602@islandtraining.com> <85zjiuea37.fsf_-_@benfinney.id.au> <8738gmxgay.fsf@elektro.pacujo.net> <87r445hdvw.fsf@elektro.pacujo.net> Date: Thu, 8 May 2014 00:30:29 +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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399473032 news.xs4all.nl 2829 [2001:888:2000:d::a6]:45035 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71024 On Thu, May 8, 2014 at 12:17 AM, Marko Rauhamaa wrote: > Weird. Some other tests of mine did work. But: > > Note: The contents of this dictionary should not be modified; changes > may not affect the values of local and free variables used by the > interpreter. [ https://docs.python.org/2/library/functions.html#locals>] If you test locals() at module level (including the interactive interpreter), things will work, because it just returns the same dict as globals() returns. It's only inside an actual function that it's different and magical. ChrisA