Skip to content
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
6 changes: 6 additions & 0 deletions src/sage/monoids/free_abelian_monoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ def is_FreeAbelianMonoid(x):

sage: from sage.monoids.free_abelian_monoid import is_FreeAbelianMonoid
sage: is_FreeAbelianMonoid(5)
doctest:warning...
DeprecationWarning: the function is_FreeAbelianMonoid is deprecated;
use 'isinstance(..., FreeAbelianMonoid_class)' instead
See https://github.com/sagemath/sage/issues/37897 for details.
False
sage: is_FreeAbelianMonoid(FreeAbelianMonoid(7,'a'))
True
Expand All @@ -177,6 +181,8 @@ def is_FreeAbelianMonoid(x):
sage: is_FreeAbelianMonoid(FreeMonoid(0,''))
False
"""
from sage.misc.superseded import deprecation
deprecation(37897, "the function is_FreeAbelianMonoid is deprecated; use 'isinstance(..., FreeAbelianMonoid_class)' instead")
return isinstance(x, FreeAbelianMonoid_class)


Expand Down
6 changes: 6 additions & 0 deletions src/sage/monoids/free_monoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def is_FreeMonoid(x):

sage: from sage.monoids.free_monoid import is_FreeMonoid
sage: is_FreeMonoid(5)
doctest:warning...
DeprecationWarning: the function is_FreeMonoid is deprecated;
use 'isinstance(..., (FreeMonoid, IndexedFreeMonoid))' instead
See https://github.com/sagemath/sage/issues/37897 for details.
False
sage: is_FreeMonoid(FreeMonoid(7,'a'))
True
Expand All @@ -56,6 +60,8 @@ def is_FreeMonoid(x):
sage: is_FreeMonoid(FreeAbelianMonoid(index_set=ZZ))
False
"""
from sage.misc.superseded import deprecation
deprecation(37897, "the function is_FreeMonoid is deprecated; use 'isinstance(..., (FreeMonoid, IndexedFreeMonoid))' instead")
if isinstance(x, FreeMonoid):
return True
from sage.monoids.indexed_free_monoid import IndexedFreeMonoid
Expand Down
6 changes: 6 additions & 0 deletions src/sage/monoids/monoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def is_Monoid(x) -> bool:

sage: from sage.monoids.monoid import is_Monoid
sage: is_Monoid(0)
doctest:warning...
DeprecationWarning: the function is_Monoid is deprecated;
use 'isinstance(..., Monoid_class)' instead
See https://github.com/sagemath/sage/issues/37897 for details.
False
sage: is_Monoid(ZZ) # The technical math meaning of monoid has
....: # no bearing whatsoever on the result: it's
Expand All @@ -26,6 +30,8 @@ def is_Monoid(x) -> bool:
sage: is_Monoid(F)
True
"""
from sage.misc.superseded import deprecation
deprecation(37897, "the function is_Monoid is deprecated; use 'isinstance(..., Monoid_class)' instead")
return isinstance(x, Monoid_class)


Expand Down