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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate is_MutablePoset #38125

Merged
merged 1 commit into from
Jun 9, 2024
Merged
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
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
Loading