[Python-3000] Set literal

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jan 28 06:38:13 CET 2008


Guido van Rossum wrote:
> On Jan 26, 2008 8:39 PM, Raymond Hettinger <python at rcn.com> wrote:
> 
>>However, my support for it has waned anyway.  The notation is also
>>used for set comprehension and those should be mutable.
> 
> Cool. That saves us a PEP. Vive le status quo.

You're changing your mind back again just like that? That's
disappointing -- I was fairly convinced there as well.

Another possibility would be to drop set comprehension
syntax and just require people to use set(genexp).

Or have set comprehensions produce frozensets and require
set(genexp) to get a mutable set.

On the face of it, it's not clear to me that the result of
a set comprehension should necessarily be mutable.

When I think about how I have used list comprehensions,
mutability of the resulting list isn't usually a requirement.
I don't expect this would be different with sets.

--
Greg


More information about the Python-3000 mailing list