[Python-Dev] syntactic support for sets (original) (raw)

David Wilson dw at botanicus.net
Thu Feb 2 01:36:24 CET 2006


On Wed, Feb 01, 2006 at 03:03:22PM -0500, Phillip J. Eby wrote:

The only case that looks slightly less than optimal is:

set((1, 2, 3, 4, 5)) But I'm not sure that it warrants a special syntax just to get rid of the extra ().

In any case I don't think it's possible to differentiate between the current calling convention and the 'parenless' one reliably, eg.:

S = set([])

There is no way to tell if that is a set containing an empty list created using the parenless syntax, or an empty set, as is created with the current calling convention.

-- DISOBEY, v.t. To celebrate with an appropriate ceremony the maturity of a command.



More information about the Python-Dev mailing list