Suggestion: Python global scope

alex23 wuwei23 at gmail.com
Wed Jul 16 02:13:24 CEST 2008


Anonymous Bastard wrote:
> In Python, declaring a variable using the global statement automatically
> makes it available in all subsequent scopes.
>
> But to me, it makes more sense to use the global statement to 'import' a
> variable from the global scope into the current scope.

My understanding is that this is exactly what the 'nonlocal' keyword
in Python 3.0 provides.

http://www.python.org/dev/peps/pep-3104/



More information about the Python-list mailing list