[Python-3000] Set literal

Nicko van Someren nicko at nicko.org
Wed Jan 30 06:28:58 CET 2008


On 28 Jan 2008, at 23:45, Greg Ewing wrote:
> Guido van Rossum wrote:
>>
...
>> Have a look at PEP 218.
>
> That PEP proposes that there be no set literal or comprehension
> syntax, and doesn't contain any discussion on whether such
> syntax should produce sets or frozensets if it were to exist.

It seems to me that this raises a critical question; would one want a  
set comprehension to produce frozen sets?  If the comprehension form  
{i for i in range(4)} should produce something mutable then I think it  
would be way too confusing for the form {0,1,2,3} to produce something  
different.  Personally I'd like set comprehensions to give me mutable  
sets, and so I feel set literals should do the same.

	Nicko



More information about the Python-3000 mailing list