Ordering python sets

Mr.SpOOn mr.spoon21 at gmail.com
Thu Nov 6 08:28:08 EST 2008


On Wed, Nov 5, 2008 at 10:03 PM, Arnaud Delobelle
<arnodel at googlemail.com> wrote:
> Only hashable objects can go in a set.  By default a class you define is
> not hashable (unless it descends from a hashable class).  To remedy this
> you can define a __hash__ method in your class.  IIRC the only
> requirement of a hash function is that two equal objects have the same
> hash.

Thanks, now it works.



More information about the Python-list mailing list