Erik Max Francis wrote: > bruno modulix wrote: > >>Err... don't you spot any useless code here ?-) >> >>(tip: dict.items() already returns a list of (k,v) tuples...) > > But it doesn't return a tuple of them. Which is what the tuple call > there does.
The useless code referred to was the list comprehension. >>> t = tuple([(k,v) for k,v in d.iteritems()]) versus >>> t = tuple(d.items()) or even >>> t = tuple(d.iteritems()) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list