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

Commit c71e098

Browse files
author
Matthias Koeppe
committed
RealSet: Fix pickling, category initialization
1 parent 03f3642 commit c71e098

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/sage/sets/real_set.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class RealSet.
6464

6565
from sage.structure.parent import Parent
6666
from sage.structure.unique_representation import UniqueRepresentation
67+
from sage.categories.sets_cat import Sets
6768
from sage.rings.all import ZZ
6869
from sage.rings.real_lazy import LazyFieldElement, RLF
6970
from sage.rings.infinity import infinity, minus_infinity
@@ -615,8 +616,12 @@ def __classcall__(cls, *args):
615616
616617
EXAMPLES::
617618
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
619620
(0, 1] + [2, 3)
621+
622+
TESTS::
623+
624+
sage: TestSuite(R).run()
620625
"""
621626
if len(args) == 1 and isinstance(args[0], RealSet):
622627
return args[0] # common optimization
@@ -644,9 +649,9 @@ def __classcall__(cls, *args):
644649
else:
645650
raise ValueError(str(arg) + ' does not determine real interval')
646651
intervals = RealSet.normalize(intervals)
647-
return UniqueRepresentation.__classcall__(cls, intervals)
652+
return UniqueRepresentation.__classcall__(cls, *intervals)
648653

649-
def __init__(self, intervals):
654+
def __init__(self, *intervals):
650655
"""
651656
A subset of the real line
652657
@@ -671,6 +676,7 @@ def __init__(self, intervals):
671676
sage: RealSet(i, [3,4]) # list of two numbers = closed set
672677
(0, 1) + [3, 4]
673678
"""
679+
Parent.__init__(self, category = Sets())
674680
self._intervals = intervals
675681

676682
def __cmp__(self, other):

0 commit comments

Comments
 (0)