Re: Hashability questions

2012-05-15 Thread Bob Grommes
On Monday, May 14, 2012 8:35:36 PM UTC-5, alex23 wrote: > 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

Hashability questions

2012-05-14 Thread Bob Grommes
Noob alert: writing my first Python class library. I have a straightforward class called Utility that lives in Utility.py. I'm trying to get a handle on best practices for fleshing out a library. As such, I've done the following for starters: def __str__(self): return str(type(self)) #