This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sdefresne
Recipients sdefresne
Date 2010-01-12.12:22:01
SpamBayes Score 0.00894073
Marked as misclassified No
Message-id <>
Python compiler detect some constant expression used in if / while statement and evaluate them at compilation. However, it does not perform some simple optimisation (evaluating not unary expression or checking if and or or expression are constant because of the first expression).

The attached patch allow Python to detect some more constant expression, and to optimise test like the following:

   if __debug__ and x:

   if not __debug__:
Date User Action Args
2010-01-12 12:22:03sdefresnesetrecipients: + sdefresne
2010-01-12 12:22:03sdefresnesetmessageid: <>
2010-01-12 12:22:01sdefresnelinkissue7682 messages
2010-01-12 12:22:01sdefresnecreate