[Python-ideas] binding vs rebinding

Arnaud Delobelle arnodel at googlemail.com
Sun Feb 8 08:16:01 CET 2009


2009年2月8日 Bruce Leban <bruce at leapyear.org>:
> There *is* something in Python related to this that I find obviously
> different and that's local and global variables. I would prefer that all
> global variables have to be included in a global declaration. I dislike the
> fact that an assignment to a variable changes other references to that same
> name from local to global references. This sort of feels like "spooky action
> at a distance" to me.

IMHO it would be very tiresome to have to declare all global functions
and builtins used in a function as global E.g.
def foo(x):
 return x + 2
def bar(x):
 global str, foo, int
 return str(foo(int(x)))
-- 
Arnaud


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /