Optimization

Geir Bjarte Terum gterum at c2i.net
Sat Oct 30 15:32:37 EDT 1999


Will statements like this be optimized away using the -o program switch?

if __debug__:
  <statements>  # Dead code in optimized version.

Is there any way to define similar *variables* for other purposes?
If not, as a workaround, will the following work?

__myflag__ = __debug__  # Set to 1 if always to be supported.

if __myflag__:
  <statements>  # Dead code in non-flagged version.

Regards
- gb -





More information about the Python-list mailing list