Tuple comprehension

Magnus Lie Hetland mlh at vier.idi.ntnu.no
Thu Apr 11 22:20:32 EDT 2002


In article <mailman.1018502663.25698.python-list at python.org>, Sean
'Shaleh' Perry wrote:
>
>On 11-Apr-2002 Emile van Sebille wrote:
>> Magnus Lie Hetland
>>> As far as I can see, the PEP on dict comprehension is still open... I
>>> think both dictionary comprehension and tuple comprehension seem like
>>> natural parallels to list comprehension. But then I would, wouldn't I?
>>> <wink>
>>>
>> 
>> Why not just tuple([my list comp]) ?
>> 
>
>because it feels wrong to create a (possibly large) list and then duplicate it
>into a tuple.  My mind sees that and thinks 'overhead'.

Of course, until we get some sort of "freezing", that is what would
have to happen behind the scenes, I imagine.

--
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org



More information about the Python-list mailing list