Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
eb3a270
sage.structure.element: Add ABCs Polynomial, MPolynomial, use for isi…
mkoeppe Dec 6, 2022
6696f5c
Use ABC MPolynomial for isinstance testing
mkoeppe Dec 6, 2022
79f7e62
Fixups
mkoeppe Dec 6, 2022
ed050bb
sage.rings.polynomial: Make it a namespace package
mkoeppe Dec 6, 2022
0613280
sage.structure.element: Introduce common base class CommutativePolyno…
mkoeppe Jan 7, 2023
27e8889
sage.structure.element: Introduce ABC InfinitePolynomial
mkoeppe Jan 7, 2023
57228f5
src/sage/structure/element.pyx: Update hierarchy in documentation
mkoeppe Jan 7, 2023
95e0adc
src/sage/structure/element.pyx: Add unique-direct-subclass tests
mkoeppe Jan 7, 2023
1fd625c
src/sage/structure/element.pyx: Add unique-direct-subclass test for E…
mkoeppe Jan 7, 2023
960506b
InfinitePolynomial: Change from constructor function to base class wi…
mkoeppe Jan 18, 2023
fd54c82
Remove ABCs sage.structure.element.*Polynomial; introduce ABCs in sag…
mkoeppe Jan 18, 2023
538c2a7
Replace use of implementation class from multi_polynomial_libsingular…
mkoeppe Jan 23, 2023
0fcb6fb
src/sage/rings/polynomial/commutative_polynomial.pyx: Add doctests
mkoeppe Jan 23, 2023
6e2adaf
InfinitePolynomial: Move _lmul_, _rmul_ here from subclasses
mkoeppe Jan 25, 2023
cdab0df
InfinitePolynomial.__classcall_private__: Add doctest
mkoeppe Jan 25, 2023
f7e9f41
Merge tag '9.8' into t/32709/sage_structure_element__add_abcs_polynom…
mkoeppe Feb 11, 2023
e06e582
src/sage/rings/polynomial/infinite_polynomial_element.py: Use Infinit…
mkoeppe Feb 12, 2023
6b557c0
Merge tag '10.0.beta0' into t/32709/sage_structure_element__add_abcs_…
mkoeppe Feb 13, 2023
8f5b799
src/sage/combinat/schubert_polynomial.py: Use isinstance(..., Infinit…
mkoeppe Feb 13, 2023
2d32a2e
Merge branch 'develop' into t/32709/sage_structure_element__add_abcs_…
mkoeppe Feb 13, 2023
95b8793
Merge branch 'develop' into t/32709/sage_structure_element__add_abcs_…
mkoeppe Feb 14, 2023
488a8b1
Merge branch 'develop' into t/32709/sage_structure_element__add_abcs_…
mkoeppe Feb 19, 2023
ffb4647
src/sage/rings/polynomial/polynomial_element.pyx: Update doctest outp…
mkoeppe Feb 20, 2023
2993660
Merge remote-tracking branch 'upstream/develop' into t/32709/sage_str…
mkoeppe Mar 3, 2023
3b65350
src/sage/quadratic_forms/quadratic_form.py: Replace use of deprecated…
mkoeppe Mar 3, 2023
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
Prev Previous commit
Next Next commit
Fixups
  • Loading branch information
Matthias Koeppe committed Jan 22, 2023
commit 79f7e62da9a4d9170c383da70a727302a4340e83
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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the deprecation message is wrong:
it should be sage.rings.polynomial.multi_polynomial.MPolynomial, no?


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 @@ -143,20 +143,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 @@ -166,15 +170,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