Raymond Hettinger <rhettin...@users.sourceforge.net> added the comment:
I would like to see the current patch finished and recorded here for reference. But I agree with Martin that changing marshal is a can of worms. The peepholer is intended to be conservative and should avoid anything that has some risk of being complicating our lives. Another approach may be more successful. Here's a rough sketch: in: LOAD_CONST 5 '{}' LOAD_ATTR 3 'format' out: LOAD_CONST 8 ('{}','format') LOAD_CONST_ATTR 7. def LOAD_CONST_ATTR(oparg): # cache the lookup of '{}.format' in a fast local x = GETLOCAL(oparg) if (x == NULL) UNPACK 2 --> obj, name bm = getattr(obj, name) STORE_FAST var LOAD_FAST var ---------- assignee: -> rhettinger nosy: +rhettinger type: -> performance versions: +Python 2.7, Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6133> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com