[Python-3000] sets in P3K?

Greg Wilson gvwilson at cs.utoronto.ca
Sun Apr 30 22:16:09 CEST 2006


> Ron Adam:
> How about the '!' which is currently used indicate a python long and an
> integer.  Here it would indicate the difference between a frozen
> container and a mutable container.
>      frozen_set = {1, 2, 3}!
>      frozen_dict = {1:'a', 2:'b', 3:'c'}!

Greg Wilson:
I mostly don't like suffix operators --- too easy to miss them when
reading code (especially if the thing they're being applied to is more
than a couple of symbols long).

> Nick Coghlan:
> set() == set{}
> set(x)              # No braced equivalent
> set([x]) == set{x}  # Ignoring list comprehensions
> set((x,)) == set{x}
> set((a, b, c)) == set{a, b, c}

I would rather stick to what we have than introduce two notations for
construction, call, subscripting, etc. --- Perl's [] vs. {} *always*
causes headaches for newcomers.

Thanks,
Greg


More information about the Python-3000 mailing list