以下の内容はhttps://anton0825.hatenablog.com/entry/2017/01/15/000000より取得しました。


Pythonで==のoverride

eqをoverrideする。

class Foo:
    def __init__(self, item):
        self.item = item

    def __eq__(self, other):
        if isinstance(other, self.__class__):
            return self.__dict__ == other.__dict__
        else:
            return False

参考:

stackoverflow.com




以上の内容はhttps://anton0825.hatenablog.com/entry/2017/01/15/000000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14