[Python-3000] Sky pie: a "var" keyword
Marcin 'Qrczak' Kowalczyk
qrczak at knm.org.pl
Mon Oct 9 21:49:54 CEST 2006
Fredrik Lundh <fredrik at pythonware.com> writes:
>> It also allows to put globals in an array instead of a dictionary,
>> making them as fast as locals.
>
> so module namespaces will no longer be populated by *executing* the
> module contents?
They would, but the set of global names except 'from module import *'
(which would need a slower lookup mechanism) could be determined
without executing it.
> what would happen if you tried to execute the following code?
>
> def foo():
> bar()
>
> def bar():
> pass
Depends on the semantics of var. I presented 3 choices.
My favorite choice is #3, for all bindings: the variable is visible in
the whole scope in which it is defined, but accessing it before its
definition has executed is an error. (Other choices are not practical
for functions.)
This means that the behavior of this code is the same as in current
Python.
--
__("< Marcin Kowalczyk
\__/ qrczak at knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/
More information about the Python-3000
mailing list