21 lines
766 B
Python

from multinut.stultus import (
EQUALS, GREATER, LESSER, GREATER_EQUAL,
LESSER_EQUAL, NOT, AND, OR
)
class StultusMixin:
def __eq__(self, other): return EQUALS(self, other)
def __gt__(self, other): return GREATER(self, other)
def __lt__(self, other): return LESSER(self, other)
def __ge__(self, other): return GREATER_EQUAL(self, other)
def __le__(self, other): return LESSER_EQUAL(self, other)
def __ne__(self, other): return NOT(EQUALS(self, other))
def __and__(self, other): return AND(self, other)
def __or__(self, other): return OR(self, other)
class StultusInt(StultusMixin, int): pass
class StultusFloat(StultusMixin, float): pass
class StultusStr(StultusMixin, str): pass
class StultusBool(StultusMixin, bool): pass