所以在Python3中,我可以使用object().__eq__。我目前使用它作为一个可映射的函数,相当于lambda x: x is object()。__eq__>>> object().__eq__
<method-wrapper '__eq__' of type object at 0x00000
下面的代码在Python3 (3.5.2)中运行良好,但在Python2中引发了一个AttributeError: 'super' object has no attribute '__eq__' (2.7.12) return super(Derived, self).__eq__(other)
a, b = Derived(1024), Derived(1729