A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/039520.html below:

[Python-Dev] closure semantics

[Python-Dev] closure semanticsSkip Montanaro skip at pobox.com
Sat Oct 25 19:03:17 EDT 2003
    Greg> global <name>

    Greg> Assignments to <name> rebind it in the next outer scope where it
    Greg> is already bound, or in the module scope if there is no existing
    Greg> binding.

    Greg> Seems about the same length as yours.

Is that compatible with current use?  I think the current semantics are that
global <name> always binds name to an object with that name at module scope.

I thought the point of this discussion was to allow the programmer to
specify the precise scope of the object to which the variable would be
bound, in the face of possibly multiple occurrences of the name.  Using the
existing syntax you have to pick one rather arbitrarily, either the module
scope or the first place you find <name>.

(Again, I have never used nested functions, so this is more of a pedantic
argument than anything for me.  Still, it seems if you're going to change
things you should make it so any instance of an outer variable can be
specified.) 

Skip

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4