optimize 'for a, b in some_dict.iteritems()'

8 views
Skip to first unread message

srepmub

unread,
Aug 13, 2011, 8:29:14 AM8/13/11
to shedskin-discuss
hi all,

shedskin currently optimizes away intermediate objects (tuples, lists,
iterator objects..) for the following constructs:

for a,b in zip(..):

for i, e in enumerate(..):

the following case came up in private conversation, and seems useful
to optimize as well:

for a,b in some_dict.iter_items():

I'm busy with some other improvements, but if anyone would be
interested in looking into this.. see def visitFor in shedskin/cpp.py
and the corresponding macros in shedskin/lib/builtin/iter.hpp :-)

thanks,
mark.
Reply all
Reply to author
Forward
0 new messages