Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
RealSet: Inherit from Set_base, Set_boolean_operators, Set_add_sub_op…
Browse files Browse the repository at this point in the history
…erators
  • Loading branch information
Matthias Koeppe committed Jun 21, 2021
1 parent e768463 commit cb93c99
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/sage/sets/real_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ class RealSet.
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.topological_spaces import TopologicalSpaces
from sage.categories.sets_cat import Sets
from sage.sets.set import Set_base, Set_boolean_operators, Set_add_sub_operators
from sage.rings.all import ZZ
from sage.rings.real_lazy import LazyFieldElement, RLF
from sage.rings.infinity import infinity, minus_infinity
Expand Down Expand Up @@ -749,7 +751,8 @@ def __rmul__(self, other):
return self * other

@richcmp_method
class RealSet(UniqueRepresentation, Parent):
class RealSet(UniqueRepresentation, Parent, Set_base,
Set_boolean_operators, Set_add_sub_operators):

@staticmethod
def __classcall__(cls, *args):
Expand Down Expand Up @@ -1513,9 +1516,6 @@ def union(self, *other):
intervals = self._intervals + other._intervals
return RealSet(*intervals)

__or__ = union
__add__ = union

def intersection(self, *other):
"""
Return the intersection of the two sets
Expand Down Expand Up @@ -1560,8 +1560,6 @@ def intersection(self, *other):
intervals.append(i1.intersection(i2))
return RealSet(*intervals)

__and__ = intersection

def inf(self):
"""
Return the infimum
Expand Down Expand Up @@ -1686,8 +1684,6 @@ def difference(self, *other):
other = RealSet(*other)
return self.intersection(other.complement())

__sub__ = difference

def contains(self, x):
"""
Return whether `x` is contained in the set
Expand Down

0 comments on commit cb93c99

Please sign in to comment.