Christoph Zwerschke <[EMAIL PROTECTED]> writes: >>>- Because sets can only contain immutable values > > Mike Meyer wrote: > >> Not true. Sets can only contain *hashable* objects, which isn't the >> same thing. > > I trusted the doco which defines a set as "an unordered collection of > immutable values" (http://docs.python.org/lib/types-set.html).
If the hash changes, you've screwed up the set. What it really should say is "collection of objects with fixed hashes", or words to that effect. Do you want to file a PR on this? > Anyway, the problems stays the same. How so? As I demonstrated, you can subclass any class that doesn't have a hash to add one, and then use the subclass, which - except for having a hash - will have exactly the same behavior as your original class. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list