Peter Otten wrote: >> executed. the compiler handles "global" and "from __future__", everything >> else is done at runtime. > > and __debug__, too, it seems:
you left out the "python -O" line. >>>> __debug__ > False >>>> def f(): > ... if __debug__: > ... global x > ... x = 42 > ... >>>> f() >>>> x > Traceback (most recent call last): > File "<stdin>", line 1, in ? > NameError: name 'x' is not defined yup, but unlike the two others, that's a CPython -O implementation issue. (I'd say bug, in this case). neither standard CPython (without -O) nor Jython behave this way. </F> -- http://mail.python.org/mailman/listinfo/python-list