[Python-3000] Set literal

Nicko van Someren nicko at nicko.org
Fri Feb 1 16:26:10 CET 2008


On 30 Jan 2008, at 23:17, Greg Ewing wrote:

> Nicko van Someren wrote:
>> Personally I'd like set comprehensions to give me mutable  sets,  
>> and so I feel set literals should do the same.
>
> Do you really want set comprehensions at all, given that
> set(genexp) exists?

Do we really want set literals at all, given that set(...) exists?

If we are going to have one then, it seems to make sense to have  
both.  If we are going to have both, I would rather that they generate  
the same type of set.  I appreciate that set literals can get  
optimised at compile time whereas comprehensions can not be optimised  
in the same way, and in the case of expressions in round brackets we  
get different types when we enclose lists vs. genexps that way, but I  
would rather we kept these things as consistent as possible.

	Nicko



More information about the Python-3000 mailing list