Skip to content

Commit

Permalink
Deprecate is_MutablePoset
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 1, 2024
1 parent 77323e2 commit b9fb9ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sage/data_structures/mutable_poset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,8 +1282,15 @@ def is_MutablePoset(P):
sage: from sage.data_structures.mutable_poset import is_MutablePoset
sage: P = MP()
sage: is_MutablePoset(P)
doctest:warning...
DeprecationWarning: The function is_MutablePoset is deprecated; use 'isinstance(..., MutablePoset)' instead.
See https://github.com/sagemath/sage/issues/38125 for details.
True
"""
from sage.misc.superseded import deprecation
deprecation(38125,
"The function is_MutablePoset is deprecated; "
"use 'isinstance(..., MutablePoset)' instead.")
return isinstance(P, MutablePoset)


Expand Down Expand Up @@ -1402,7 +1409,7 @@ def __init__(self, data=None, key=None, merge=None, can_merge=None):
...
TypeError: 33 is not iterable; do not know what to do with it.
"""
if is_MutablePoset(data):
if isinstance(data, MutablePoset):
if key is not None:
raise TypeError('Cannot use key when data is a poset.')
self._copy_shells_(data, lambda e: e)
Expand Down

0 comments on commit b9fb9ec

Please sign in to comment.