Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions src/sage/rings/commutative_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Abstract base class for commutative algebras
"""

#*****************************************************************************
# ***************************************************************************
# Copyright (C) 2005 William Stein <wstein@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
Expand All @@ -15,24 +15,6 @@
# The full text of the GPL is available at:
#
# https://www.gnu.org/licenses/
#*****************************************************************************
# ***************************************************************************

from sage.categories.commutative_algebras import CommutativeAlgebras


def is_CommutativeAlgebra(x):
"""
Check to see if ``x`` is in the category of ``CommutativeAlgebras``.

EXAMPLES::

sage: from sage.rings.commutative_algebra import is_CommutativeAlgebra
sage: is_CommutativeAlgebra(QQ['x'])
doctest:warning...
DeprecationWarning: the function is_CommutativeAlgebra is deprecated; use '... in Algebras(base_ring).Commutative()' instead
See https://github.com/sagemath/sage/issues/35999 for details.
True
"""
from sage.misc.superseded import deprecation
deprecation(35999, "the function is_CommutativeAlgebra is deprecated; use '... in Algebras(base_ring).Commutative()' instead")
return x in CommutativeAlgebras(x.base_ring())
23 changes: 0 additions & 23 deletions src/sage/rings/complex_double.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -694,29 +694,6 @@ cdef ComplexDoubleElement new_ComplexDoubleElement():
return z


def is_ComplexDoubleElement(x):
"""
Return ``True`` if ``x`` is a :class:`ComplexDoubleElement`.

EXAMPLES::

sage: from sage.rings.complex_double import is_ComplexDoubleElement
sage: is_ComplexDoubleElement(0)
doctest:warning...
DeprecationWarning: The function is_ComplexDoubleElement is deprecated;
use 'isinstance(..., ComplexDoubleElement)' instead.
See https://github.com/sagemath/sage/issues/38128 for details.
False
sage: is_ComplexDoubleElement(CDF(0))
True
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38128,
"The function is_ComplexDoubleElement is deprecated; "
"use 'isinstance(..., ComplexDoubleElement)' instead.")
return isinstance(x, ComplexDoubleElement)


cdef class ComplexDoubleElement(FieldElement):
"""
An approximation to a complex number using double precision
Expand Down
23 changes: 0 additions & 23 deletions src/sage/rings/complex_interval.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -74,29 +74,6 @@ from sage.rings.convert.mpfi cimport mpfi_set_sage
from sage.rings.infinity import infinity


def is_ComplexIntervalFieldElement(x):
"""
Check if ``x`` is a :class:`ComplexIntervalFieldElement`.

EXAMPLES::

sage: from sage.rings.complex_interval import is_ComplexIntervalFieldElement as is_CIFE
sage: is_CIFE(CIF(2))
doctest:warning...
DeprecationWarning: The function is_ComplexIntervalFieldElement is deprecated;
use 'isinstance(..., ComplexIntervalFieldElement)' instead.
See https://github.com/sagemath/sage/issues/38128 for details.
True
sage: is_CIFE(CC(2))
False
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38128,
"The function is_ComplexIntervalFieldElement is deprecated; "
"use 'isinstance(..., ComplexIntervalFieldElement)' instead.")
return isinstance(x, ComplexIntervalFieldElement)


cdef class ComplexIntervalFieldElement(FieldElement):
"""
A complex interval.
Expand Down
40 changes: 0 additions & 40 deletions src/sage/rings/complex_mpfr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -119,46 +119,6 @@ def set_global_complex_round_mode(n):
rnd = n


def is_ComplexNumber(x):
r"""
Return ``True`` if ``x`` is a complex number. In particular, if ``x`` is
of the :class:`ComplexNumber` type.

EXAMPLES::

sage: from sage.rings.complex_mpfr import is_ComplexNumber
sage: a = ComplexNumber(1, 2); a
1.00000000000000 + 2.00000000000000*I
sage: is_ComplexNumber(a)
doctest:warning...
DeprecationWarning: The function is_ComplexNumber is deprecated;
use 'isinstance(..., ComplexNumber)' instead.
See https://github.com/sagemath/sage/issues/38128 for details.
True
sage: b = ComplexNumber(1); b
1.00000000000000
sage: is_ComplexNumber(b)
True

Note that the global element ``I`` is a number field element, of type
:class:`sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_gaussian`,
while elements of the class :class:`ComplexField_class`
are of type :class:`ComplexNumber`::

sage: c = 1 + 2*I
sage: is_ComplexNumber(c)
False
sage: d = CC(1 + 2*I)
sage: is_ComplexNumber(d)
True
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38128,
"The function is_ComplexNumber is deprecated; "
"use 'isinstance(..., ComplexNumber)' instead.")
return isinstance(x, ComplexNumber)


cache = {}


Expand Down
24 changes: 0 additions & 24 deletions src/sage/rings/finite_rings/integer_mod.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -205,30 +205,6 @@ def IntegerMod(parent, value):
return t(parent, value)


def is_IntegerMod(x):
"""
Return ``True`` if and only if x is an integer modulo
`n`.

EXAMPLES::

sage: from sage.rings.finite_rings.integer_mod import is_IntegerMod
sage: is_IntegerMod(5)
doctest:warning...
DeprecationWarning: The function is_IntegerMod is deprecated;
use 'isinstance(..., IntegerMod_abstract)' instead.
See https://github.com/sagemath/sage/issues/38128 for details.
False
sage: is_IntegerMod(Mod(5,10))
True
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38128,
"The function is_IntegerMod is deprecated; "
"use 'isinstance(..., IntegerMod_abstract)' instead.")
return isinstance(x, IntegerMod_abstract)


cdef inline inverse_or_None(x):
try:
return ~x
Expand Down
23 changes: 0 additions & 23 deletions src/sage/rings/fraction_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,29 +142,6 @@ def FractionField(R, names=None):
return R.fraction_field()


def is_FractionField(x) -> bool:
"""
Test whether or not ``x`` inherits from :class:`FractionField_generic`.

EXAMPLES::

sage: from sage.rings.fraction_field import is_FractionField
sage: is_FractionField(Frac(ZZ['x']))
doctest:warning...
DeprecationWarning: The function is_FractionField is deprecated;
use 'isinstance(..., FractionField_generic)' instead.
See https://github.com/sagemath/sage/issues/38128 for details.
True
sage: is_FractionField(QQ)
False
"""
from sage.misc.superseded import deprecation
deprecation(38128,
"The function is_FractionField is deprecated; "
"use 'isinstance(..., FractionField_generic)' instead.")
return isinstance(x, FractionField_generic)


class FractionField_generic(ring.Field):
"""
The fraction field of an integral domain.
Expand Down
26 changes: 0 additions & 26 deletions src/sage/rings/fraction_field_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,6 @@ import sage.misc.latex as latex
import sage.misc.superseded


def is_FractionFieldElement(x) -> bool:
"""
Return whether or not ``x`` is a :class:`FractionFieldElement`.

EXAMPLES::

sage: from sage.rings.fraction_field_element import is_FractionFieldElement
sage: R.<x> = ZZ[]
sage: is_FractionFieldElement(x/2)
doctest:warning...
DeprecationWarning: The function is_FractionFieldElement is deprecated;
use 'isinstance(..., FractionFieldElement)' instead.
See https://github.com/sagemath/sage/issues/38128 for details.
False
sage: is_FractionFieldElement(2/x)
True
sage: is_FractionFieldElement(1/3)
False
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38128,
"The function is_FractionFieldElement is deprecated; "
"use 'isinstance(..., FractionFieldElement)' instead.")
return isinstance(x, FractionFieldElement)


cdef class FractionFieldElement(FieldElement):
"""
EXAMPLES::
Expand Down
41 changes: 0 additions & 41 deletions src/sage/rings/ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,47 +206,6 @@ def Ideal(*args, **kwds):
return I


def is_Ideal(x):
r"""
Return ``True`` if object is an ideal of a ring.

EXAMPLES:

A simple example involving the ring of integers. Note
that Sage does not interpret rings objects themselves as ideals.
However, one can still explicitly construct these ideals::

sage: from sage.rings.ideal import is_Ideal
sage: R = ZZ
sage: is_Ideal(R)
doctest:warning...
DeprecationWarning: The function is_Ideal is deprecated; use 'isinstance(..., Ideal_generic)' instead.
See https://github.com/sagemath/sage/issues/38266 for details.
False
sage: 1*R; is_Ideal(1*R)
Principal ideal (1) of Integer Ring
True
sage: 0*R; is_Ideal(0*R)
Principal ideal (0) of Integer Ring
True

Sage recognizes ideals of polynomial rings as well::

sage: R = PolynomialRing(QQ, 'x'); x = R.gen()
sage: I = R.ideal(x^2 + 1); I
Principal ideal (x^2 + 1) of Univariate Polynomial Ring in x over Rational Field
sage: is_Ideal(I)
True
sage: is_Ideal((x^2 + 1)*R)
True
"""
from sage.misc.superseded import deprecation
deprecation(38266,
"The function is_Ideal is deprecated; "
"use 'isinstance(..., Ideal_generic)' instead.")
return isinstance(x, Ideal_generic)


class Ideal_generic(MonoidElement):
"""
An ideal.
Expand Down
27 changes: 0 additions & 27 deletions src/sage/rings/integer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -321,33 +321,6 @@ mpz_init(PARI_PSEUDOPRIME_LIMIT)
mpz_ui_pow_ui(PARI_PSEUDOPRIME_LIMIT, 2, 64)


def is_Integer(x):
"""
Return ``True`` if ``x`` is of the Sage :class:`Integer` type.

EXAMPLES::

sage: from sage.rings.integer import is_Integer
sage: is_Integer(2)
doctest:warning...
DeprecationWarning: The function is_Integer is deprecated;
use 'isinstance(..., Integer)' instead.
See https://github.com/sagemath/sage/issues/38128 for details.
True
sage: is_Integer(2/1)
False
sage: is_Integer(int(2))
False
sage: is_Integer('5')
False
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38128,
"The function is_Integer is deprecated; "
"use 'isinstance(..., Integer)' instead.")
return isinstance(x, Integer)


cdef inline Integer as_Integer(x):
if isinstance(x, Integer):
return <Integer>x
Expand Down
27 changes: 0 additions & 27 deletions src/sage/rings/integer_ring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -86,33 +86,6 @@ cdef int number_of_integer_rings = 0
_prev_discrete_gaussian_integer_sampler = (None, None)


def is_IntegerRing(x):
r"""
Internal function: return ``True`` iff ``x`` is the ring `\ZZ` of integers.

TESTS::

sage: from sage.rings.integer_ring import is_IntegerRing
sage: is_IntegerRing(ZZ)
doctest:warning...
DeprecationWarning: The function is_IntegerRing is deprecated;
use 'isinstance(..., IntegerRing_class)' instead.
See https://github.com/sagemath/sage/issues/38128 for details.
True
sage: is_IntegerRing(QQ)
False
sage: is_IntegerRing(parent(3))
True
sage: is_IntegerRing(parent(1/3))
False
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38128,
"The function is_IntegerRing is deprecated; "
"use 'isinstance(..., IntegerRing_class)' instead.")
return isinstance(x, IntegerRing_class)


cdef class IntegerRing_class(CommutativeRing):
r"""
The ring of integers.
Expand Down
28 changes: 0 additions & 28 deletions src/sage/rings/laurent_series_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,6 @@
lazy_import('sage.rings.power_series_ring', 'PowerSeriesRing_generic')


def is_LaurentSeriesRing(x):
"""
Return ``True`` if this is a *univariate* Laurent series ring.

This is in keeping with the behavior of ``is_PolynomialRing``
versus ``is_MPolynomialRing``.

TESTS::

sage: from sage.rings.laurent_series_ring import is_LaurentSeriesRing
sage: K.<q> = LaurentSeriesRing(QQ)
sage: is_LaurentSeriesRing(K)
doctest:warning...
DeprecationWarning: The function is_LaurentSeriesRing is deprecated;
use 'isinstance(..., (LaurentSeriesRing, LazyLaurentSeriesRing))' instead.
See https://github.com/sagemath/sage/issues/38290 for details.
True
sage: L.<z> = LazyLaurentSeriesRing(QQ)
sage: is_LaurentSeriesRing(L)
True
"""
from sage.misc.superseded import deprecation
deprecation(38290,
"The function is_LaurentSeriesRing is deprecated; "
"use 'isinstance(..., (LaurentSeriesRing, LazyLaurentSeriesRing))' instead.")
return isinstance(x, (LaurentSeriesRing, LazyLaurentSeriesRing))


class LaurentSeriesRing(UniqueRepresentation, Parent):
r"""
Univariate Laurent Series Ring.
Expand Down
Loading
Loading