>   d = {}
>   for key, d[key] in (("this",18), ("that",17), ("other",38)):
>     print key
>     do_something(d)
>

Why not use a dict comprehension?
d = {k:v for k,v in  (("this",18), ("that",17), ("other",38))}

I feel this is more straightforward and easier to read. the results are the
same however.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to