INNER CODE UNIT · Python

__eq__

KwaiAppTeam/KOOM · koom-common/kwai-android-base/src/main/cpp/fmtlib/support/docopt.py:34

    def __eq__(self, other):
        return repr(self) == repr(other)

    def __hash__(self):
        return hash(repr(self))

    def fix(self):
        self.fix_identities()
        self.fix_repeating_arguments()
        return self

    def fix_identities(self, uniq=None):
        """Make pattern-tree tips point to same object if they are equal."""
        if not hasattr(self, 'children'):
            return self
        uniq = list(set(self.flat())) if uniq is None else uniq
        for i, child in enumerate(self.children):
            if not hasattr(child, 'children'):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…