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.0089407265
Marked as misclassified No
Message-id <1263298923.43.0.408416060324.issue7682@psf.upfronthosting.co.za>
In-reply-to
Content
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:
       pass

   if not __debug__:
       pass
History
Date User Action Args
2010-01-12 12:22:03sdefresnesetrecipients: + sdefresne
2010-01-12 12:22:03sdefresnesetmessageid: <1263298923.43.0.408416060324.issue7682@psf.upfronthosting.co.za>
2010-01-12 12:22:01sdefresnelinkissue7682 messages
2010-01-12 12:22:01sdefresnecreate