Skip to content

Commit 1dc709c

Browse files
author
Matthias Koeppe
committed
sage.rings.{integer,rational}: Copy numbers abc registration here from sage.rings.numbers_abc
1 parent 056b8d4 commit 1dc709c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/sage/rings/integer.pyx

+5
Original file line numberDiff line numberDiff line change
@@ -7564,3 +7564,8 @@ cdef double mpz_get_d_nearest(mpz_t x) except? -648555075988944.5:
75647564
if resultsign < 0:
75657565
d = -d
75667566
return ldexp(d, shift)
7567+
7568+
7569+
# Support Python's numbers abstract base class
7570+
import numbers
7571+
numbers.Integral.register(Integer)

src/sage/rings/rational.pyx

+5
Original file line numberDiff line numberDiff line change
@@ -4297,3 +4297,8 @@ cdef class long_to_Q(Morphism):
42974297
'Native'
42984298
"""
42994299
return "Native"
4300+
4301+
4302+
# Support Python's numbers abstract base class
4303+
import numbers
4304+
numbers.Rational.register(Rational)

0 commit comments

Comments
 (0)