Beispiel #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
Beispiel #2
0
def test_random():
    w1 = attrs.Wavelength(193*u.AA)
    w2 = attrs.Series('spam')
    assert jsoc.jsoc.and_(w1 | w2) == AttrOr([w1, w2])
Beispiel #3
0
def test_starred_or_different_types(obj):
    assert Starred() | obj == AttrOr([Starred(), obj])
Beispiel #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])