[Python-3000] Draft PEP for outer scopes

Ka-Ping Yee python at zesty.ca
Sat Nov 4 22:54:03 CET 2006


On Thu, 2 Nov 2006, Andrew McNamara wrote:
> >The global scope is the widest scope in which you can declare a variable.
>
> This is inaccurate at best.

No, my statement is correct.  What you are disputing is not what i wrote:

The global scope is the widest scope in which you can declare a variable.

You cannot declare variables in builtin scope in Python.  You can stuff
variables into the builtin module with some manipulation, but it is a
very rare thing to do, it is not encouraged as a normal style of
programming, and it is not supported by the language syntax.

Python, C/C++, JavaScript, Ruby, and Perl all have this in common:

    A "global variable" is visible to the entire file and does
    not belong to any particular function.

> To be honest, I'm +0 on using "global" in the way GvR proposes. My
> point is that python's globals are already different from other common
> languages, and people cope with that.

That does not constitute an argument in favour of anything.

For example, Python's integers are already different from other common
languages, because they have unlimited range.  That is not a reason to
make "integers" include, say, floating point numbers.


-- ?ing


More information about the Python-3000 mailing list