Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'suppose': 0.07; 'sep': 0.09; 'language': 0.14; '"from': 0.16; '2",': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:variable': 0.16; 'tool.': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'example.': 0.17; 'tend': 0.17; 'import': 0.21; 'supposed': 0.21; "python's": 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'in.': 0.27; 'message-id:@mail.gmail.com': 0.27; "aren't": 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.36; '12,': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'close': 0.63 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:to :content-type; bh=1rsJWAkeeze/krVV9WOMTLyqMjzaL0mSZ9WLIlqyCXM=; b=KsUFHgPbOQ9FvLOVwEGXkGZ7mimdZClEcqOEwi9Zi634sAluvpqzpR6cAlLpH2O5cy vWUu+T5no3WyNC8HQY1U8odTaRr02z+7rbAB1Ug5/eOi4AZEQ9uY1Yv9p2UGxN1eze/H To0DEPxvt40cNcLouO0Q+/P9IA+wZVJh2huMt4W80KWJvo8EXFYefsHJtcOQ4Vi1hJvS G29nhW1BN9kIDxDjv03OgEAi5DH+Wq3Xaj+Re5g+oZFDruiszGj6EDzhTSNWzS0Yj0He +NNp1k7UWBHa4WnGkW3cSAvn3aMAp+LQZ0ztWc3LdazYWcMNtdoeSEZkjcoNKNheO+3F Zmzg== MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 12 Sep 2012 08:52:10 +1000 Subject: Re: Double sided double underscored variable names From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347403933 news.xs4all.nl 6848 [2001:888:2000:d::a6]:47754 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28910 On Wed, Sep 12, 2012 at 8:48 AM, Joshua Landau wrote: > Well, the problem is that a lot of collisions aren't predictable. > "locals()['foo'] = 2", for example. If it weren't for Python's annoying > flexibility* I would definitely do something very close to what you suggest. > Remember that "locals()" isn't Python's only introspection tool. How about > "from foo import *"? You're not supposed to mutate locals(), but I suppose globals() works the same way. Inline functions? I like this idea. I tend to want them in pretty much any language I write in. ChrisA