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