[Python-3000] sets in P3K?

Baptiste Carvello baptiste13 at altern.org
Fri Apr 28 00:39:52 CEST 2006


Ron Adam a écrit :
> Raymond Hettinger wrote:
>>I forsee {} vs {/} as being a prominent entry on everyone's list of Python pitfalls, faqs, and common errors.  Maybe PyLint or PyChecker will be able to scan to see how the object is used and determine whether the two were mixed-up.
>>
> 
> I think I really prefer the {:} for an empty dictionary, and {} for an 
> empty set. 

Actually I think we need both {/} as the empty set and {:} as the empty dict.

{} should raise SyntaxError, '{} is ambiguous, use {/} for set, {:} for dict'

If we decide to have both dict and set litteral, {} will *always* be ambiguous. 
Lots of bugs can be avoided if we just forbid it.

Baptiste



More information about the Python-3000 mailing list