Skip to content

Commit

Permalink
Update doctests with deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed May 2, 2024
1 parent 3c3f1fc commit ec7ef43
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/sage/categories/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -2571,6 +2571,10 @@ def is_Category(x):
EXAMPLES::
sage: sage.categories.category.is_Category(CommutativeAdditiveSemigroups())
doctest:warning...
DeprecationWarning: the function is_Category is deprecated;
use 'isinstance(..., Category)' instead
See https://github.com/sagemath/sage/issues/37922 for details.
True
sage: sage.categories.category.is_Category(ZZ)
False
Expand Down
11 changes: 8 additions & 3 deletions src/sage/categories/homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,6 @@ def End(X, category=None):
from Alternating group of order 3!/2 as a permutation group
to Alternating group of order 3!/2 as a permutation group
in Category of finite enumerated permutation groups
sage: from sage.categories.homset import is_Endset
sage: is_Endset(S)
True
sage: S.domain()
Alternating group of order 3!/2 as a permutation group
Expand Down Expand Up @@ -1298,6 +1295,10 @@ def is_Homset(x):
sage: P.<t> = ZZ[]
sage: f = P.hom([1/2*t])
sage: is_Homset(f)
doctest:warning...
DeprecationWarning: the function is_Homset is deprecated;
use 'isinstance(..., Homset)' instead
See https://github.com/sagemath/sage/issues/37922 for details.
False
sage: is_Homset(f.category())
False
Expand All @@ -1319,6 +1320,10 @@ def is_Endset(x):
sage: P.<t> = ZZ[]
sage: f = P.hom([1/2*t])
sage: is_Endset(f.parent())
doctest:warning...
DeprecationWarning: the function is_Endset is deprecated;
use 'isinstance(..., Homset) and ....is_endomorphism_set()' instead
See https://github.com/sagemath/sage/issues/37922 for details.
False
sage: g = P.hom([2*t])
sage: is_Endset(g.parent())
Expand Down
4 changes: 4 additions & 0 deletions src/sage/rings/homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def is_RingHomset(H):
sage: from sage.rings.homset import is_RingHomset as is_RH
sage: is_RH(Hom(ZZ, QQ))
doctest:warning...
DeprecationWarning: the function is_RingHomset is deprecated;
use 'isinstance(..., RingHomset_generic)' instead
See https://github.com/sagemath/sage/issues/37922 for details.
True
sage: is_RH(ZZ)
False
Expand Down
4 changes: 4 additions & 0 deletions src/sage/structure/parent.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ def is_Parent(x):
sage: from sage.structure.parent import is_Parent
sage: is_Parent(2/3)
doctest:warning...
DeprecationWarning: the function is_Parent is deprecated;
use 'isinstance(..., Parent)' instead
See https://github.com/sagemath/sage/issues/37922 for details.
False
sage: is_Parent(ZZ)
True
Expand Down
4 changes: 4 additions & 0 deletions src/sage/topology/simplicial_complex_homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def is_SimplicialComplexHomset(x) -> bool:
in Category of finite simplicial complexes
sage: from sage.topology.simplicial_complex_homset import is_SimplicialComplexHomset
sage: is_SimplicialComplexHomset(H)
doctest:warning...
DeprecationWarning: the function is_SimplicialComplexHomset is deprecated;
use 'isinstance(..., SimplicialComplexHomset)' instead
See https://github.com/sagemath/sage/issues/37922 for details.
True
"""
from sage.misc.superseded import deprecation
Expand Down

0 comments on commit ec7ef43

Please sign in to comment.