Skip to content

Commit

Permalink
Deprecate is_Infinite
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Jun 26, 2024
1 parent 8d0ba74 commit ee7f9d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/sage/rings/infinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,10 @@ def is_Infinite(x) -> bool:
EXAMPLES::
sage: sage.rings.infinity.is_Infinite(oo)
doctest:warning...
DeprecationWarning: The function is_Infinite is deprecated;
use 'isinstance(..., InfinityElement)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True
sage: sage.rings.infinity.is_Infinite(-oo)
True
Expand All @@ -988,6 +992,9 @@ def is_Infinite(x) -> bool:
sage: sage.rings.infinity.is_Infinite(ZZ)
False
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_Infinite is deprecated; use 'isinstance(..., InfinityElement)' instead.")

return isinstance(x, InfinityElement)


Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/power_series_ring_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ With power series the behavior is the same.
# ****************************************************************************

from cpython.object cimport Py_EQ, Py_NE
from sage.rings.infinity import infinity, is_Infinite
from sage.rings.infinity import infinity, InfinityElement

from sage.rings.rational_field import QQ

Expand Down

0 comments on commit ee7f9d1

Please sign in to comment.