[Python-Dev] Scope, not context? (was Re: PEP 550 v3 naming) (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Thu Aug 24 19:58:32 EDT 2017
- Previous message (by thread): [Python-Dev] Scope, not context? (was Re: PEP 550 v3 naming)
- Next message (by thread): [Python-Dev] Scope, not context? (was Re: PEP 550 v3 naming)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Barry Warsaw wrote:
I actually think Python’s scoping rules are fairly easy to grasp,
The problem is that the word "scope", as generally used in relation to programming languages, has to do with visibility of names. A variable is "in scope" at a particular point in the code if you can acccess it just by writing its name there. The things we're talking about are never "in scope" in that sense.
What we have is something similar to a dynamic scope, but a special action is required to access bindings in it. I can't think of any established term for things like that.
The closest I'ves seen is one dialect of Scheme that called it a "fluid environment". In that dialect, fluid-let didn't create bindings in the normal scope, and you had to use specific functions to access them.
-- Greg
- Previous message (by thread): [Python-Dev] Scope, not context? (was Re: PEP 550 v3 naming)
- Next message (by thread): [Python-Dev] Scope, not context? (was Re: PEP 550 v3 naming)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]