Skip to content

Commit

Permalink
sagemathgh-37342: remove some old deprecations in functional.py
Browse files Browse the repository at this point in the history
    
remove functions deprecated in late 2021

in sagemath#32347

### 📝 Checklist

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
    
URL: sagemath#37342
Reported by: Frédéric Chapoton
Reviewer(s): grhkm21
  • Loading branch information
Release Manager committed Feb 19, 2024
2 parents 5d3dca9 + b0037ce commit 67c6dfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 63 deletions.
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 @@ def symbolic_sum(expression, *args, **kwds):
"""
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)


def symbolic_prod(expression, *args, **kwds):
Expand Down Expand Up @@ -848,22 +846,6 @@ def xinterval(a, b):
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 @@ def is_even(x):
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

0 comments on commit 67c6dfc

Please sign in to comment.