diff --git a/src/sage/libs/mpmath/ext_main.pyx b/src/sage/libs/mpmath/ext_main.pyx index f1a406598f2..03840b3d8df 100644 --- a/src/sage/libs/mpmath/ext_main.pyx +++ b/src/sage/libs/mpmath/ext_main.pyx @@ -580,8 +580,7 @@ cdef class Context: s = (x).re.special t = (x).im.special return s == S_NAN or t == S_NAN - if isinstance(x, (int, Integer)) \ - or isinstance(x, rationallib.mpq): + if isinstance(x, (int, Integer, rationallib.mpq)): return False typ = MPF_set_any(&tmp_opx_re, &tmp_opx_im, x, global_opts, 0) if typ == 1: @@ -622,8 +621,7 @@ cdef class Context: s = (x).re.special t = (x).im.special return s == S_INF or s == S_NINF or t == S_INF or t == S_NINF - if isinstance(x, (int, Integer)) \ - or isinstance(x, rationallib.mpq): + if isinstance(x, (int, Integer, rationallib.mpq)): return False typ = MPF_set_any(&tmp_opx_re, &tmp_opx_im, x, global_opts, 0) if typ == 1: @@ -671,8 +669,7 @@ cdef class Context: if re == libmp.fzero: return im_normal if im == libmp.fzero: return re_normal return re_normal and im_normal - if isinstance(x, (int, Integer)) \ - or isinstance(x, rationallib.mpq): + if isinstance(x, (int, Integer, rationallib.mpq)): return bool(x) x = ctx.convert(x) if hasattr(x, '_mpf_') or hasattr(x, '_mpc_'): diff --git a/src/sage/rings/finite_rings/finite_field_base.pyx b/src/sage/rings/finite_rings/finite_field_base.pyx index 256be4e6bf5..332fedc4713 100644 --- a/src/sage/rings/finite_rings/finite_field_base.pyx +++ b/src/sage/rings/finite_rings/finite_field_base.pyx @@ -1358,7 +1358,7 @@ cdef class FiniteField(Field): False """ from sage.rings.integer_ring import ZZ - if R in int or R is ZZ: + if R is int or R is ZZ: return True if isinstance(R, sage.rings.abc.IntegerModRing) and self.characteristic().divides(R.characteristic()): return R.hom((self.one(),), check=False) diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx index f99f8ab2a54..f3de6a7ca6d 100644 --- a/src/sage/rings/real_mpfi.pyx +++ b/src/sage/rings/real_mpfi.pyx @@ -816,9 +816,7 @@ cdef class RealIntervalField_class(sage.rings.abc.RealIntervalField): prec = self._prec # Direct and efficient conversions - if S is ZZ or S is QQ: - return True - if S is int: + if S is ZZ or S is QQ or S is int: return True if isinstance(S, RealIntervalField_class): return (S)._prec >= prec