Merge pull request #1534 from xonsh/lazy_intersection

add __or__ to lazyobject
This commit is contained in:
Konstantinos Tsakiltzidis 2016-08-05 19:11:46 +03:00 committed by GitHub
commit c92211a453
2 changed files with 17 additions and 0 deletions

13
news/lazy_union.rst Normal file
View file

@ -0,0 +1,13 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* LazyObject supports set union
**Security:** None

View file

@ -112,6 +112,10 @@ class LazyObject(object):
obj = self._lazy_obj()
return hash(obj)
def __or__(self, other):
obj = self._lazy_obj()
return obj | other
def lazyobject(f):
"""Decorator for constructing lazy objects from a function."""