On May 14, 5:11 am, Bob Grommes <bob.grom...@gmail.com> wrote:
> Obviously there is some sort of default implementation of __hash__()
> at work and my implementation of _eq_() has somehow broken it.
> Can anyone explain what's going on?

It looks like this has changed between Python 2 and 3:

"If a class does not define an __eq__() method it should not define a
__hash__() operation either; if it defines __eq__() but not
__hash__(), its instances will not be usable as items in hashable
collections."

From: http://docs.python.org/dev/reference/datamodel.html#object.__hash__

You should just be able to add a __hash__ to Utility and it'll be fine.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to