Lib.Krakatau.ssa.constraints.mixin.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of krakatau-lib Show documentation
Show all versions of krakatau-lib Show documentation
Assembler, disassebmler, decompiler and compiler tools library for Java.
class ValueType(object):
'''Define _key() and inherit from this class to implement comparison and hashing'''
# def __init__(self, *args, **kwargs): super(ValueType, self).__init__(*args, **kwargs)
def __eq__(self, other): return type(self) == type(other) and self._key() == other._key()
def __ne__(self, other): return type(self) != type(other) or self._key() != other._key()
def __hash__(self): return hash(self._key())
© 2015 - 2025 Weber Informatics LLC | Privacy Policy