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.

Of course, but the list-to-tuple conversion is not the point here. The
useless part might be more obvious in this snippet:

my_list = [(1, 'one'), (2, 'two'), (3, 'three')]
my_tup = tuple([(k, v) for k, v in my_list])


-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to