は、Python 3(3.5.2)で正常に動作しますが、Pythonの2にAttributeError: 'super' object has no attribute '__eq__'
を上げる(2.7.12)__eq__コードの部分に続いて
class Derived(int):
def __eq__(self, other):
return super(Derived, self).__eq__(other)
a, b = Derived(1024), Derived(1729)
print(a == b)
Pythonの3動作が期待されています。私はこの質問がここで何が起こっている'super' object has no attribute '__eq__'
Python 2では 'int'には豊富な比較演算子がありません([here](http://stackoverflow.com/questions/10809932/python-why-does-the-int-class-not-have-rich参照) -comparison-operators-like-lt))。 Python 3は豊富な比較演算子を実装しています。 '__cmp__'は欠損しています。 –