Message58124
A new behavior was introduced in r59106 in python trunk, which look
suspicious to me. Basically, every time a class defines a comparison
operator, it's __hash__ method is defined to None. The simple following
example shows it:
>>> class A(object):
... def __init__(self, b):
... self.b = b
... def __cmp__(self, other):
... if not isinstance(other, A):
... return -1
... return cmp(self.b, other.b)
...
>>> hash(A(2))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not callable
The problematic change is here:
Objects/typeobject.c?rev=59106&r1=58032&r2=59106">http://svn.python.org/view/python/trunk/Objects/typeobject.c?rev=59106&r1=58032&r2=59106
And mainly the overrides_hash call in inherit_slots.
FWIW, I've encounter the problem because zope.interface is now usable on
trunk. |
|
| Date |
User |
Action |
Args |
| 2007-12-03 13:51:31 | therve | set | spambayes_score: 0.0608274 -> 0.0608274 recipients:
+ therve |
| 2007-12-03 13:51:31 | therve | set | spambayes_score: 0.0608274 -> 0.0608274 messageid: <1196689891.72.0.237226656542.issue1549@psf.upfronthosting.co.za> |
| 2007-12-03 13:51:31 | therve | link | issue1549 messages |
| 2007-12-03 13:51:30 | therve | create | |
|