Merge pull request #1423 from xonsh/lazydm

more lazy object data models
This commit is contained in:
Konstantinos Tsakiltzidis 2016-07-13 19:16:10 +03:00 committed by GitHub
commit eeb8e8b939

View file

@ -81,6 +81,33 @@ class LazyObject(object):
obj = self._lazy_obj() obj = self._lazy_obj()
return obj(*args, **kwargs) return obj(*args, **kwargs)
def __lt__(self, other):
obj = self._lazy_obj()
return obj < other
def __le__(self, other):
obj = self._lazy_obj()
return obj <= other
def __eq__(self, other):
obj = self._lazy_obj()
return obj == other
def __ne__(self, other):
obj = self._lazy_obj()
return obj != other
def __gt__(self, other):
obj = self._lazy_obj()
return obj > other
def __ge__(self, other):
obj = self._lazy_obj()
return obj >= other
def __hash__(self):
obj = self._lazy_obj()
return hash(obj)
def lazyobject(f): def lazyobject(f):