builtin set literal

Schüle Daniel uval at rz.uni-karlsruhe.de
Thu Feb 15 03:20:18 EST 2007


Steven Bethard schrieb:
> Schüle Daniel wrote:
>> Hello,
>>
>> lst = list((1,2,3))
>> lst = [1,2,3]
>>
>> t = tupel((1,2,3))
>> t = (1,2,3)
>>
>> s = set((1,2,3))
>> s = ...
>>
>> it would be nice feature to have builtin literal for set type
>> maybe in P3 .. what about?
>> s = <1,2,3>
> 
> In Python 3.0, this looks like::
> 
>     s = {1,2,3}

jepp, that looks not bad .. as in a mathe book.
the only disadvantage I see, that one may confuse it with a dict.

Regards, Daniel



More information about the Python-list mailing list