@@ -86,7 +86,7 @@ class RealSet.
86
86
#*****************************************************************************
87
87
88
88
from sage .structure .richcmp import richcmp , richcmp_method
89
- from sage .structure .parent import Parent
89
+ from sage .structure .parent import Parent , Set_generic
90
90
from sage .structure .unique_representation import UniqueRepresentation
91
91
from sage .categories .topological_spaces import TopologicalSpaces
92
92
from sage .rings .all import ZZ
@@ -724,7 +724,7 @@ def __rmul__(self, other):
724
724
return self * other
725
725
726
726
@richcmp_method
727
- class RealSet (UniqueRepresentation , Parent ):
727
+ class RealSet (UniqueRepresentation , Set_generic ):
728
728
729
729
@staticmethod
730
730
def __classcall__ (cls , * args ):
@@ -1044,6 +1044,31 @@ def get_interval(self, i):
1044
1044
"""
1045
1045
return self ._intervals [i ]
1046
1046
1047
+ def object (self ):
1048
+ """
1049
+ Return the underlying object of ``self``.
1050
+
1051
+ EXAMPLES::
1052
+
1053
+ sage: RealSet(0,1).object()
1054
+ (0, 1)
1055
+ """
1056
+ return self
1057
+
1058
+ def __nonzero__ (self ):
1059
+ """
1060
+ A set is considered True unless it is empty, in which case it is
1061
+ considered to be False.
1062
+
1063
+ EXAMPLES::
1064
+
1065
+ sage: bool(RealSet(0, 1))
1066
+ True
1067
+ sage: bool(RealSet())
1068
+ False
1069
+ """
1070
+ return not self .is_empty ()
1071
+
1047
1072
__getitem__ = get_interval
1048
1073
1049
1074
# ParentMethods of Subobjects
0 commit comments