Skip to content

Commit 028e704

Browse files
author
Release Manager
committed
Trac #33801: sage.misc.sage_input: Remove import from sage.all
URL: https://trac.sagemath.org/33801 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Frédéric Chapoton
2 parents 2649fa7 + 73f4ab7 commit 028e704

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sage/misc/sage_input.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -481,18 +481,20 @@ def __call__(self, x, coerced=False):
481481
# floats could often have prettier output,
482482
# but I think they're rare enough in Sage that it's not
483483
# worth the effort.
484-
from sage.all import RR, ZZ, infinity
485-
if x == float(infinity):
484+
from math import inf
485+
if x == inf:
486486
return self.name('float')(self.name('infinity'))
487487
if x != x:
488488
return self.name('float')(self.name('NaN'))
489-
if x == -float(infinity):
489+
if x == -inf:
490490
return -self.name('float')(self.name('infinity'))
491491
if self._preparse is False and float(str(x)) == x:
492492
if x < 0:
493493
return -SIE_literal_stringrep(self, str(-x))
494494
else:
495495
return SIE_literal_stringrep(self, str(x))
496+
from sage.rings.real_mpfr import RR
497+
from sage.rings.integer_ring import ZZ
496498
rrx = RR(x)
497499
if rrx in ZZ and abs(rrx) < (1 << 53):
498500
return self.name('float')(self.int(ZZ(rrx)))

0 commit comments

Comments
 (0)