[Python-Dev] Explicit Lexical Scoping (pre-PEP?)

Andrew Koenig ark at acm.org
Thu Jul 6 17:40:23 CEST 2006


> However I still don't believe "global" has the stretchiness in its
> meaning that you claim it has. Have you ever heard a Python programmer
> talking about closures use the word "global variable"?

I guess the term I've heard most often is "free variable," but I wouldn't be
surprised if I saw the term "global" used to describe a free variable.

However, I should point out that Dijkstra used "global" in a similar way in
his 1971 book "A Discipline of Programming."  The program examples in that
book are in a language he devised for the purpose; one of the language's
features is that every variable used in every block must be explicitly
declared, even if it is taken from a surrounding block.  If I remember
correctly, the terms he used for variables taken from a surrounding block
and variables defined and used in the same block were "global" and
"private," respectively.





More information about the Python-Dev mailing list