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 holdenweb
Recipients benjamin.peterson, eryksun, holdenweb, methane, pitrou, vstinner
Date 2014-03-28.08:18:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395994699.93.0.299343335927.issue21074@psf.upfronthosting.co.za>
In-reply-to
Content
Is a fix really required? Are we really supposed to protect programmers from their own folly by second-guessing when constant folding might be required and when it might not? How is hte interpreter supposed to know the function isn't called?

The simple solution to this problem is available in Python: simply declare a manifest constant and use that instead:

UNCALLED_SIZE = 2**32
def uncalled():
    x = b'x' * UNCALLED_SIZE

I'd recommend closing this issue (though I'm glad that people are concerned with optimization, I don't think that an optimizer should be too concerned with those rare cases when their optimization doesn't optimize.

But I'm not going to close it: wiser heads than mine are required.
History
Date User Action Args
2014-03-28 08:18:19holdenwebsetrecipients: + holdenweb, pitrou, vstinner, benjamin.peterson, methane, eryksun
2014-03-28 08:18:19holdenwebsetmessageid: <1395994699.93.0.299343335927.issue21074@psf.upfronthosting.co.za>
2014-03-28 08:18:19holdenweblinkissue21074 messages
2014-03-28 08:18:19holdenwebcreate