以下代码在python 2.7中有效,但在python 3.5中失败:
class Base(object):
def __hash__(self):
return 4
class Derived(Base): pass
class DerivedEquatable(Base):
def __eq__(self, other):
return False
assert Base.__hash__ is not None
assert Derived.__hash__ is not None
assert DerivedEquatable.__hash__ is not None # AssertionError in python 3
此行为更改记录在哪里?