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 serhiy.storchaka
Recipients BTaskaya, Mark.Shannon, pablogsal, pxeger, serhiy.storchaka
Date 2020-12-28.21:50:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609192200.74.0.0717993357543.issue42754@roundup.psfhosted.org>
In-reply-to
Content
I do not think there are serious raesons for adding this optimization. The Python compiler was intentionally made simple for maintainability. Constant folding supports only base arithmetic and bits operations because they are often used in constant expressions (like 2**32-1 or 1<<18) and indexing because of b'A'[0]. Neither comparisons, nor boolean operators with constants are optimized, because such expression are uncommon, and the maintaining cost overdraws benefit.

This is a similar case. I am -1 for this optimization.
History
Date User Action Args
2020-12-28 21:50:00serhiy.storchakasetrecipients: + serhiy.storchaka, Mark.Shannon, pablogsal, BTaskaya, pxeger
2020-12-28 21:50:00serhiy.storchakasetmessageid: <1609192200.74.0.0717993357543.issue42754@roundup.psfhosted.org>
2020-12-28 21:50:00serhiy.storchakalinkissue42754 messages
2020-12-28 21:50:00serhiy.storchakacreate