Skip to content

Commit f398a0f

Browse files
committed
Apply suggested changes
1 parent 2b08102 commit f398a0f

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/sage/libs/mpmath/ext_main.pyx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,7 @@ cdef class Context:
580580
s = (<mpc>x).re.special
581581
t = (<mpc>x).im.special
582582
return s == S_NAN or t == S_NAN
583-
if isinstance(x, (int, Integer)) \
584-
or isinstance(x, rationallib.mpq):
583+
if isinstance(x, (int, Integer, rationallib.mpq)):
585584
return False
586585
typ = MPF_set_any(&tmp_opx_re, &tmp_opx_im, x, global_opts, 0)
587586
if typ == 1:
@@ -622,8 +621,7 @@ cdef class Context:
622621
s = (<mpc>x).re.special
623622
t = (<mpc>x).im.special
624623
return s == S_INF or s == S_NINF or t == S_INF or t == S_NINF
625-
if isinstance(x, (int, Integer)) \
626-
or isinstance(x, rationallib.mpq):
624+
if isinstance(x, (int, Integer, rationallib.mpq)):
627625
return False
628626
typ = MPF_set_any(&tmp_opx_re, &tmp_opx_im, x, global_opts, 0)
629627
if typ == 1:
@@ -671,8 +669,7 @@ cdef class Context:
671669
if re == libmp.fzero: return im_normal
672670
if im == libmp.fzero: return re_normal
673671
return re_normal and im_normal
674-
if isinstance(x, (int, Integer)) \
675-
or isinstance(x, rationallib.mpq):
672+
if isinstance(x, (int, Integer, rationallib.mpq)):
676673
return bool(x)
677674
x = ctx.convert(x)
678675
if hasattr(x, '_mpf_') or hasattr(x, '_mpc_'):

src/sage/rings/finite_rings/finite_field_base.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ cdef class FiniteField(Field):
13581358
False
13591359
"""
13601360
from sage.rings.integer_ring import ZZ
1361-
if R in int or R is ZZ:
1361+
if R is int or R is ZZ:
13621362
return True
13631363
if isinstance(R, sage.rings.abc.IntegerModRing) and self.characteristic().divides(R.characteristic()):
13641364
return R.hom((self.one(),), check=False)

src/sage/rings/real_mpfi.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,7 @@ cdef class RealIntervalField_class(sage.rings.abc.RealIntervalField):
816816
prec = self._prec
817817

818818
# Direct and efficient conversions
819-
if S is ZZ or S is QQ:
820-
return True
821-
if S is int:
819+
if S is ZZ or S is QQ or S is int:
822820
return True
823821
if isinstance(S, RealIntervalField_class):
824822
return (<RealIntervalField_class>S)._prec >= prec

0 commit comments

Comments
 (0)