const for bytecode optimization...

Skip Montanaro skip at
Fri Feb 11 21:52:29 CET 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 |
skip at |
"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