Guido van Rossum:
> # We could use these equivalencies:
> assert {1} == {1: None} == set({1: "a"}) # I.e. canonical sets have
> all None values
An alternative canonical representation of a set as a dict could be a
dict d for which d[k] is k for k in d.keys().
Guido van Rossum:
> Also, sets would grow some operations that don't make a lot of sense
> (e.g. __getitem__, get, setdefault) but that's minor once you know the
> same implementation is used.
These operations will see some use if sets behave as identity
dictionaries, for example, setdefault will become an interning
operation.
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com