[Python-3000] Set literal
Greg Ewing
greg.ewing at canterbury.ac.nz
Tue Jan 29 03:24:24 CET 2008
Guido van Rossum wrote:
> No, but it *does* make 'set' the "default" type, making you work
> harder to get a frozenset. From this it follows that frozenset was
> considered the lesser-useful type at the time.
That logic assumes that one of them necessarily has to be
harder to get than the other, therefore we have to pick
one to be the "default".
With no literal syntax there might be some truth in that,
but with a literal syntax it no longer holds. We can have
the literal syntax produce one and set() produce the
other.
What's more, the recent discussion has put forward what
seems like an excellent use for frozensets, i.e. making
'if x in {1, 2, 3}' highly optimisable.
The original PEP doesn't explicity address any of these
arguments. Even if they're rejected, they deserve to be
set out in a PEP along with the reasons for rejection,
I think, to stop them from recurring.
--
Greg
More information about the Python-3000
mailing list