mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Merge pull request #1423 from xonsh/lazydm
more lazy object data models
This commit is contained in:
commit
eeb8e8b939
1 changed files with 27 additions and 0 deletions
|
@ -81,6 +81,33 @@ class LazyObject(object):
|
|||
obj = self._lazy_obj()
|
||||
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):
|
||||
|
|
Loading…
Add table
Reference in a new issue