[Python-3000] Sky pie: a "var" keyword

Fredrik Lundh fredrik at pythonware.com
Mon Oct 9 12:05:01 CEST 2006


Neil Toronto wrote:

> A "var" keyword fixes them all. The "global" gotcha:
>
> x = 0
> def f():
>    print x   # no exception - prints "0"
>    x = 3
>
> def g():
>    print x   # exception
>    var x = 3

what are the exact semantics of "var" ?  are you saying that local variables
should be global by default?

</F> 





More information about the Python-3000 mailing list