Author alex
Recipients alex, belopolsky, benjamin.peterson, dmalcolm, jhylton, nnorwitz, rhettinger, sdahlbac, thomaslee, titanstar
Date 2010-11-06.01:02:50
SpamBayes Score 5.2402e-06
Marked as misclassified No
Message-id <1289005373.84.0.252680867012.issue1346238@psf.upfronthosting.co.za>
In-reply-to
Content
ISTM that you don't need to worry about mutating locals, the locals() function is explicitly documented as not necessarily affecting local variables (not sure if frame objects have the same documentation).

If you want a free optimization opportunity: BINARY_SUBSCR with a list for the first argument who's contents are all constant, this can be optimized to turn it into a tuple which can be load const'd (as we do in the case of an in check), note that this cannot be used in the case of::

    l = [1, 2, 3]
    l[v]

As v.__index__ could theoretically mutate l.
History
Date User Action Args
2010-11-06 01:02:54alexsetrecipients: + alex, jhylton, nnorwitz, rhettinger, belopolsky, sdahlbac, titanstar, thomaslee, benjamin.peterson, dmalcolm
2010-11-06 01:02:53alexsetmessageid: <1289005373.84.0.252680867012.issue1346238@psf.upfronthosting.co.za>
2010-11-06 01:02:52alexlinkissue1346238 messages
2010-11-06 01:02:51alexcreate