Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28910

Re: Double sided double underscored variable names

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 <rosuav@gmail.com>
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 <CAN1F8qUuXho43hPdGKyh3sAyZHx7JegFfSEU+JhqwyA552a=DA@mail.gmail.com>
References <CAN1F8qXpeHAQGJG9urY2NjL_01gX++cMhkgiD3mt3nZsYzYcJQ@mail.gmail.com> <CAPTjJmqh8V9kZm3bQ-BHGDc-qsEuxykh8DCg4s3z5x+JcxW-WA@mail.gmail.com> <CAN1F8qUuXho43hPdGKyh3sAyZHx7JegFfSEU+JhqwyA552a=DA@mail.gmail.com>
Date Wed, 12 Sep 2012 08:52:10 +1000
Subject Re: Double sided double underscored variable names
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.526.1347403933.27098.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Wed, Sep 12, 2012 at 8:48 AM, Joshua Landau
<joshua.landau.ws@gmail.com> 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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Double sided double underscored variable names Chris Angelico <rosuav@gmail.com> - 2012-09-12 08:52 +1000
  Re: Double sided double underscored variable names Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-12 01:14 +0000
    Re: Double sided double underscored variable names Chris Angelico <rosuav@gmail.com> - 2012-09-12 14:12 +1000
    Re: Double sided double underscored variable names Joshua Landau <joshua.landau.ws@gmail.com> - 2012-09-12 10:55 +0100

csiph-web