[Python-3000] Set literal

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Jan 31 00:11:28 CET 2008


Mike Klaas wrote:

> over 120k loc:
> 
> All uses of set():
> 
> $ pygrep '[^.a-z]set[(]' | grep -v unittest | wc
>      320    1583   24774
> 
> Empty set():
> 
> $ pygrep '[^.a-z]set[(][)]' | grep -v unittest | wc
>      114     478    7406

But that doesn't count uses of tuples that could be
turned into frozenset literals if such a thing existed.

> I think that 'set()' is a perfectly fine and readable empty set  
> "literal".

Are you talking only about empty sets? If so, then I
agree. I thought you were talking about all potential
uses of set literals.

--
Greg


More information about the Python-3000 mailing list