Thomas Heller wrote: > Just use the builtin __debug__ variable for that purpose. > __debug__ is 'True' if Python is run normally, and 'False' > if run with the '-O' or '-OO' command line flag. > The optimizer works in the way you describe above (which > it will not if you use a custom variable).
Thanks, I didn't know that __debug__ was optimized like this. But that was really just a specific example of the general case. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list