const for bytecode optimization...
Skip Montanaro
skip at mojam.com
Fri Feb 11 15:52:29 EST 2000
Michael> The time machines strikes again (and again and again ...). The
Michael> variable you are looking for exists.
Michael> It is called __debug__:
...
I'll expand briefly on what Michael said:
1. When compiling to bytecodes with the optimize flag, no code is generated
in an if __debug__.
2. When not optimizing the assert statement byte compiles to an if __debug__
construct as well.
Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
"Languages that change by catering to the tastes of non-users tend not to do
so well." - Doug Landauer
More information about the Python-list
mailing list