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

Commit

Permalink
Trac #30830: same name yields same instance
Browse files Browse the repository at this point in the history
  • Loading branch information
mjungmath committed Oct 31, 2020
1 parent 224ab51 commit 200942c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/sage/manifolds/differentiable/examples/real_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,27 @@ class RealLine(OpenInterval):
[Real interval (0, 1), Real number line R]
"""
@staticmethod
def __classcall__(cls, name='R', latex_name=r'\Bold{R}', coordinate=None,
names=None, start_index=0):
r"""
Determine the correct interval to return based upon the input.
TESTS::
sage: R = RealLine(); R
Real number line R
sage: R1 = RealLine('R'); R1
Real number line R
sage: R is R1
True
"""
return super(cls, RealLine).__classcall__(cls, name=name,
latex_name=latex_name,
coordinate=coordinate,
names=names, start_index=start_index)

def __init__(self, name='R', latex_name=r'\Bold{R}', coordinate=None,
names=None, start_index=0):
r"""
Expand Down

0 comments on commit 200942c

Please sign in to comment.