Double sided double underscored variable names

Chris Angelico rosuav at gmail.com
Tue Sep 11 18:52:10 EDT 2012


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



More information about the Python-list mailing list