Tuple comprehension
Magnus Lie Hetland
mlh at vier.idi.ntnu.no
Thu Apr 11 22:19:40 EDT 2002
In article <%r7t8.37204$CU.41841 at rwcrnsc51.ops.asp.att.net>, 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]) ?
I thought I mentioned that in my post. Oh, well.
Of course you can do that. Just like you can use a for-loop instead of
list comprehensions -- they're not essential at all either. Just
compact and readable.
--
Magnus Lie Hetland The Anygui Project
http://hetland.org http://anygui.org
More information about the Python-list
mailing list