@@ -64,6 +64,7 @@ class RealSet.
64
64
65
65
from sage .structure .parent import Parent
66
66
from sage .structure .unique_representation import UniqueRepresentation
67
+ from sage .categories .sets_cat import Sets
67
68
from sage .rings .all import ZZ
68
69
from sage .rings .real_lazy import LazyFieldElement , RLF
69
70
from sage .rings .infinity import infinity , minus_infinity
@@ -615,8 +616,12 @@ def __classcall__(cls, *args):
615
616
616
617
EXAMPLES::
617
618
618
- sage: RealSet(RealSet.open_closed(0,1), RealSet.closed_open(2,3))
619
+ sage: R = RealSet(RealSet.open_closed(0,1), RealSet.closed_open(2,3)); R
619
620
(0, 1] + [2, 3)
621
+
622
+ TESTS::
623
+
624
+ sage: TestSuite(R).run()
620
625
"""
621
626
if len (args ) == 1 and isinstance (args [0 ], RealSet ):
622
627
return args [0 ] # common optimization
@@ -644,9 +649,9 @@ def __classcall__(cls, *args):
644
649
else :
645
650
raise ValueError (str (arg ) + ' does not determine real interval' )
646
651
intervals = RealSet .normalize (intervals )
647
- return UniqueRepresentation .__classcall__ (cls , intervals )
652
+ return UniqueRepresentation .__classcall__ (cls , * intervals )
648
653
649
- def __init__ (self , intervals ):
654
+ def __init__ (self , * intervals ):
650
655
"""
651
656
A subset of the real line
652
657
@@ -671,6 +676,7 @@ def __init__(self, intervals):
671
676
sage: RealSet(i, [3,4]) # list of two numbers = closed set
672
677
(0, 1) + [3, 4]
673
678
"""
679
+ Parent .__init__ (self , category = Sets ())
674
680
self ._intervals = intervals
675
681
676
682
def __cmp__ (self , other ):
0 commit comments