Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Dec 6, 2022
1 parent 32c729d commit 4185472
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/sage/libs/symmetrica/symmetrica.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ cdef void late_import():
SymmetricFunctions, \
sqrt, \
builtinlist, \
MPolynomialRing_base, is_MPolynomial,\
MPolynomialRing_base, MPolynomial,\
SchubertPolynomialRing, SchubertPolynomial_class,\
two, fifteen, thirty, zero, sage_maxint

Expand Down Expand Up @@ -454,7 +454,7 @@ cdef void late_import():
import sage.rings.polynomial.multi_polynomial_ring
MPolynomialRing_base = sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_base
import sage.rings.polynomial.multi_polynomial_element
is_MPolynomial = sage.rings.polynomial.multi_polynomial_element.is_MPolynomial
MPolynomial = sage.structure.element.MPolynomial

import sage.combinat.schubert_polynomial
SchubertPolynomialRing = sage.combinat.schubert_polynomial.SchubertPolynomialRing
Expand Down
3 changes: 3 additions & 0 deletions src/sage/rings/polynomial/multi_polynomial.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ from sage.misc.derivative import multi_derivative
from sage.misc.misc_c import prod

def is_MPolynomial(x):
from sage.misc.superseded import deprecation
deprecation(32709, "the function is_MPolynomial is deprecated; use isinstance(x, sage.structure.element.MPolynomial) instead")

return isinstance(x, MPolynomial)

from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
Expand Down
17 changes: 12 additions & 5 deletions src/sage/rings/polynomial/polynomial_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,24 @@ cpdef is_Polynomial(f):
"""
Return True if f is of type univariate polynomial.
This function is deprecated.
INPUT:
- ``f`` -- an object
EXAMPLES::
sage: from sage.structure.element import Polynomial
sage: from sage.rings.polynomial.polynomial_element import is_Polynomial
sage: R.<x> = ZZ[]
sage: isinstance(x^3 + x + 1, Polynomial)
sage: is_Polynomial(x^3 + x + 1)
doctest:...: DeprecationWarning: the function is_Polynomial is deprecated; use isinstance(x, sage.structure.element.Polynomial) instead
See https://trac.sagemath.org/32709 for details.
True
sage: S.<y> = R[]
sage: f = y^3 + x*y -3*x; f
y^3 + x*y - 3*x
sage: isinstance(f, Polynomial)
sage: is_Polynomial(f)
True
However this function does not return True for genuine multivariate
Expand All @@ -165,15 +169,18 @@ cpdef is_Polynomial(f):
sage: R.<x,y> = QQ[]
sage: f = y^3 + x*y -3*x; f
y^3 + x*y - 3*x
sage: isinstance(f, Polynomial)
sage: is_Polynomial(f)
False
sage: var('x,y')
(x, y)
sage: f = y^3 + x*y -3*x; f
y^3 + x*y - 3*x
sage: isinstance(f, Polynomial)
sage: is_Polynomial(f)
False
"""
from sage.misc.superseded import deprecation
deprecation(32709, "the function is_Polynomial is deprecated; use isinstance(x, sage.structure.element.Polynomial) instead")

return isinstance(f, Polynomial)

from .polynomial_compiled cimport CompiledPolynomialFunction
Expand Down

0 comments on commit 4185472

Please sign in to comment.