Mr.SpOOn wrote:
It seems that I solved my main problem, but I still have some doubt.I thought this would work, but I was wrong. I had to rewrite __eq__ with the same code of __cmp__ Why it doesn't work with __cmp__ or __hash__ ?
Sets and dicts use __hash__ and __eq__ together, as documented."If a class does not define an __eq__() method it should not define a __hash__() operation either;" (3.0 manual, but same earlier).
-- http://mail.python.org/mailman/listinfo/python-list