Exemplo n.º 1
0
 def __or__(self, other):
     if not isinstance(other, self.make):
         return AttrOr([self, other])
     attr = self.make()
     attr.value = self.value or other.value
     return attr
Exemplo n.º 2
0
def test_random():
    w1 = attrs.Wavelength(193*u.AA)
    w2 = attrs.Series('spam')
    assert jsoc.jsoc.and_(w1 | w2) == AttrOr([w1, w2])
Exemplo n.º 3
0
def test_starred_or_different_types(obj):
    assert Starred() | obj == AttrOr([Starred(), obj])
Exemplo n.º 4
0
 def __or__(self, other):
     if self == other:
         return self
     if isinstance(other, self.__class__):
         return self.__class__([self.value, other.value])
     return AttrOr([self, other])