[Python-3000] sets in P3K?

Georg Brandl g.brandl at gmx.net
Tue May 2 21:21:13 CEST 2006


Raymond Hettinger wrote:
>>That doesn't fix everybody's brain though. Given that sets are much
>>less universally useful than dicts I don't think that dict should
>>"give in".
>>
>>
>>  
>>
> Right. Changes to the {} notation for empty dicts should be off the 
> table lest we have a lifetime of regrets.  Set literals are not worth 
> committing atrocities elsewhere in the language.
> 
> I think Guido had the best solution.  Use set() for empty sets, use {} 
> for empty dicts, use {genexp} for set comprehensions/displays, use 
> {1,2,3} for explicit set literals, and use {k1:v1, k2:v2} for dict 
> literals.  We can always add {/} later if demand exceeds distaste.

+1.

Georg



More information about the Python-3000 mailing list