def __or__ ( self , other ) : if not isinstance ( other , set ) : return NotImplemented return self . union ( other )
python two range union
Return the union of two RangeSets as a new RangeSet .
def __or__(self, other):
        """Return the union of two RangeSets as a new RangeSet.

        (I.e. all elements that are in either set.)
        """
        if not isinstance(other, set):
            return NotImplemented
        return self.union(other)