Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove some old deprecations in functional.py #37342

Merged
merged 2 commits into from
Feb 25, 2024
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
3 changes: 0 additions & 3 deletions src/sage/misc/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@
integral_closure,
interval,
xinterval,
is_commutative,
is_even,
is_integrally_closed,
is_field,
is_odd,
kernel,
krull_dimension,
Expand Down
63 changes: 3 additions & 60 deletions src/sage/misc/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import math

from sage.misc.lazy_import import lazy_import
from sage.misc.superseded import deprecation

lazy_import('sage.rings.complex_double', 'CDF')
lazy_import('sage.rings.real_double', ['RDF', 'RealDoubleElement'])
Expand Down Expand Up @@ -589,11 +588,10 @@
"""
if hasattr(expression, 'sum'):
return expression.sum(*args, **kwds)
elif max(len(args),len(kwds)) <= 1:
if max(len(args), len(kwds)) <= 1:
return sum(expression, *args, **kwds)
else:
from sage.symbolic.ring import SR
return SR(expression).sum(*args, **kwds)
from sage.symbolic.ring import SR
return SR(expression).sum(*args, **kwds)

Check warning on line 594 in src/sage/misc/functional.py

View check run for this annotation

Codecov / codecov/patch

src/sage/misc/functional.py#L593-L594

Added lines #L593 - L594 were not covered by tests


def symbolic_prod(expression, *args, **kwds):
Expand Down Expand Up @@ -848,22 +846,6 @@
return range(a, b + 1)


def is_commutative(x):
"""
Return whether or not ``x`` is commutative.

EXAMPLES::

sage: R = PolynomialRing(QQ, 'x')
sage: is_commutative(R)
doctest:...DeprecationWarning: use X.is_commutative() or X in Rings().Commutative()
See https://github.com/sagemath/sage/issues/32347 for details.
True
"""
deprecation(32347, "use X.is_commutative() or X in Rings().Commutative()")
return x.is_commutative()


def is_even(x):
"""
Return whether or not an integer ``x`` is even, e.g., divisible by 2.
Expand All @@ -883,45 +865,6 @@
return x % 2 == 0


def is_integrally_closed(x):
"""
Return whether ``x`` is integrally closed.

EXAMPLES::

sage: is_integrally_closed(QQ)
doctest:...DeprecationWarning: use X.is_integrally_closed()
See https://github.com/sagemath/sage/issues/32347 for details.
True
sage: x = polygen(ZZ, 'x')
sage: K.<a> = NumberField(x^2 + 189*x + 394) # needs sage.rings.number_field
sage: R = K.order(2*a) # needs sage.rings.number_field
sage: is_integrally_closed(R) # needs sage.rings.number_field
False
"""
deprecation(32347, "use X.is_integrally_closed()")
return x.is_integrally_closed()


def is_field(x, proof=True):
"""
Return whether or not ``x`` is a field.

Alternatively, one can use ``x in Fields()``.

EXAMPLES::

sage: R = PolynomialRing(QQ, 'x')
sage: F = FractionField(R)
sage: is_field(F)
doctest:...DeprecationWarning: use X.is_field() or X in Fields()
See https://github.com/sagemath/sage/issues/32347 for details.
True
"""
deprecation(32347, "use X.is_field() or X in Fields()")
return x.is_field(proof=proof)


def is_odd(x):
"""
Return whether or not ``x`` is odd.
Expand Down
Loading