builtin set literal

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


faulkner schrieb:
> On Feb 14, 11:55 am, Schüle Daniel <u... at rz.uni-karlsruhe.de> 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>
>>
>> Regards, Daniel
> 
> sets aren't quite that useful or common. just use a list.
> and '<' and '>' already have syntactic meanings.

well, I thought about this
the empty set <> has the meaning of != now
as far as I remember is <> depricated and will disappear
When they are gone in P3000, <> could be reused as empty set.

> and that would make python look more like C++, which nobody wants.

I dont think that actually many people fear this.
we have {} for dicts and I doubt anybody mistake them for C++ brakets.

In my previuos post I forgot to mention

d = dict()
d = {}

s = set()
s = <>

why not, on the first sight everybody will see ... here our
algorithmus deals with unique things/objects ... put in a set.

Regards, Daniel



More information about the Python-list mailing list