Alex <alex.gay...@gmail.com> added the comment: 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. ---------- nosy: +alex _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue1346238> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com