diff --git a/src/sage/rings/infinity.py b/src/sage/rings/infinity.py index ecf711d5fff..427a34ecf04 100644 --- a/src/sage/rings/infinity.py +++ b/src/sage/rings/infinity.py @@ -970,35 +970,6 @@ def _richcmp_(self, other, op) -> bool: less_than_infinity = UnsignedInfinityRing.less_than_infinity() -def is_Infinite(x) -> bool: - """ - This is a type check for infinity elements. - - 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 - sage: sage.rings.infinity.is_Infinite(unsigned_infinity) - True - sage: sage.rings.infinity.is_Infinite(3) - False - sage: sage.rings.infinity.is_Infinite(RR(infinity)) - False - 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) - - class SignError(ArithmeticError): """ Sign error exception. @@ -1007,7 +978,7 @@ class SignError(ArithmeticError): class InfinityRing_class(Singleton, CommutativeRing): - def __init__(self): + def __init__(self) -> None: """ Initialize ``self``. diff --git a/src/sage/schemes/affine/affine_space.py b/src/sage/schemes/affine/affine_space.py index 702381f6ea4..ca344102dd3 100644 --- a/src/sage/schemes/affine/affine_space.py +++ b/src/sage/schemes/affine/affine_space.py @@ -38,28 +38,6 @@ _Fields = Fields() -def is_AffineSpace(x) -> bool: - r""" - Return ``True`` if ``x`` is an affine space. - - EXAMPLES:: - - sage: from sage.schemes.affine.affine_space import is_AffineSpace - sage: is_AffineSpace(AffineSpace(5, names='x')) - doctest:warning... - DeprecationWarning: The function is_AffineSpace is deprecated; use 'isinstance(..., AffineSpace_generic)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - sage: is_AffineSpace(AffineSpace(5, GF(9, 'alpha'), names='x')) # needs sage.rings.finite_rings - True - sage: is_AffineSpace(Spec(ZZ)) - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_AffineSpace is deprecated; use 'isinstance(..., AffineSpace_generic)' instead.") - return isinstance(x, AffineSpace_generic) - - def AffineSpace(n, R=None, names=None, ambient_projective_space=None, default_embedding_index=None): r""" diff --git a/src/sage/schemes/berkovich/berkovich_space.py b/src/sage/schemes/berkovich/berkovich_space.py index 1330c408f4a..f2b56c967c6 100644 --- a/src/sage/schemes/berkovich/berkovich_space.py +++ b/src/sage/schemes/berkovich/berkovich_space.py @@ -48,54 +48,6 @@ lazy_import('sage.rings.number_field.number_field_ideal', 'NumberFieldFractionalIdeal') -def is_Berkovich(space) -> bool: - """ - Check if ``space`` is a Berkovich space. - - OUTPUT: - - - ``True`` if ``space`` is a Berkovich space. - - ``False`` otherwise. - - EXAMPLES:: - - sage: B = Berkovich_Cp_Projective(3) - sage: from sage.schemes.berkovich.berkovich_space import is_Berkovich - sage: is_Berkovich(B) - doctest:warning... - DeprecationWarning: The function is_Berkovich is deprecated; use 'isinstance(..., Berkovich)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_Berkovich is deprecated; use 'isinstance(..., Berkovich)' instead.") - return isinstance(space, Berkovich) - - -def is_Berkovich_Cp(space) -> bool: - """ - Check if ``space`` is a Berkovich space over ``Cp``. - - OUTPUT: - - - ``True`` if ``space`` is a Berkovich space over ``Cp``. - - ``False`` otherwise. - - EXAMPLES:: - - sage: B = Berkovich_Cp_Projective(3) - sage: from sage.schemes.berkovich.berkovich_space import is_Berkovich_Cp - sage: is_Berkovich_Cp(B) - doctest:warning... - DeprecationWarning: The function is_Berkovich_Cp is deprecated; use 'isinstance(..., Berkovich_Cp)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_Berkovich_Cp is deprecated; use 'isinstance(..., Berkovich_Cp)' instead.") - return isinstance(space, Berkovich_Cp) - - class Berkovich(UniqueRepresentation, Parent): """ The parent class for any Berkovich space diff --git a/src/sage/schemes/elliptic_curves/ell_generic.py b/src/sage/schemes/elliptic_curves/ell_generic.py index c7e329c24e1..ccb565d3732 100644 --- a/src/sage/schemes/elliptic_curves/ell_generic.py +++ b/src/sage/schemes/elliptic_curves/ell_generic.py @@ -88,27 +88,6 @@ exp = math.exp -def is_EllipticCurve(x): - r""" - Utility function to test if ``x`` is an instance of an Elliptic Curve class. - - EXAMPLES:: - - sage: from sage.schemes.elliptic_curves.ell_generic import is_EllipticCurve - sage: E = EllipticCurve([1,2,3/4,7,19]) - sage: is_EllipticCurve(E) - doctest:warning... - DeprecationWarning: The function is_EllipticCurve is deprecated; use 'isinstance(..., EllipticCurve_generic)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - sage: is_EllipticCurve(0) - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_EllipticCurve is deprecated; use 'isinstance(..., EllipticCurve_generic)' instead.") - return isinstance(x, EllipticCurve_generic) - - class EllipticCurve_generic(WithEqualityById, plane_curve.ProjectivePlaneCurve): r""" Elliptic curve over a generic base ring. diff --git a/src/sage/schemes/generic/algebraic_scheme.py b/src/sage/schemes/generic/algebraic_scheme.py index da36a587bd6..33793544355 100644 --- a/src/sage/schemes/generic/algebraic_scheme.py +++ b/src/sage/schemes/generic/algebraic_scheme.py @@ -135,69 +135,6 @@ from . import scheme -def is_AlgebraicScheme(x): - """ - Test whether ``x`` is an algebraic scheme. - - INPUT: - - - ``x`` -- anything - - OUTPUT: - - boolean; whether ``x`` is an algebraic scheme, that is, a - subscheme of an ambient space over a ring defined by polynomial - equations. - - EXAMPLES:: - - sage: A2 = AffineSpace(2, QQ, 'x, y') - sage: A2.coordinate_ring().inject_variables() - Defining x, y - sage: V = A2.subscheme([x^2 + y^2]); V - Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: - x^2 + y^2 - sage: from sage.schemes.generic.algebraic_scheme import is_AlgebraicScheme - sage: is_AlgebraicScheme(V) - doctest:warning... - DeprecationWarning: The function is_AlgebraicScheme is deprecated; use 'isinstance(..., AlgebraicScheme)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - - Affine space is itself not an algebraic scheme, though the closed - subscheme defined by no equations is:: - - sage: from sage.schemes.generic.algebraic_scheme import is_AlgebraicScheme - sage: is_AlgebraicScheme(AffineSpace(10, QQ)) - False - sage: V = AffineSpace(10, QQ).subscheme([]); V - Closed subscheme of Affine Space of dimension 10 over Rational Field defined by: - (no polynomials) - sage: is_AlgebraicScheme(V) - True - - We create a more complicated closed subscheme:: - - sage: A,x = AffineSpace(10, QQ).objgens() - sage: X = A.subscheme([sum(x)]); X - Closed subscheme of Affine Space of dimension 10 over Rational Field defined by: - x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 - sage: is_AlgebraicScheme(X) - True - - :: - - sage: is_AlgebraicScheme(QQ) - False - sage: S = Spec(QQ) - sage: is_AlgebraicScheme(S) - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_AlgebraicScheme is deprecated; use 'isinstance(..., AlgebraicScheme)' instead.") - return isinstance(x, AlgebraicScheme) - - # **************************************************************************** # A quick overview over the class hierarchy: # @@ -219,7 +156,7 @@ class AlgebraicScheme(scheme.Scheme): defined by equations in affine, projective, or toric ambient spaces. """ - def __init__(self, A, category=None): + def __init__(self, A, category=None) -> None: """ TESTS:: diff --git a/src/sage/schemes/generic/ambient_space.py b/src/sage/schemes/generic/ambient_space.py index b2aaf4a8e99..3e72c43b046 100644 --- a/src/sage/schemes/generic/ambient_space.py +++ b/src/sage/schemes/generic/ambient_space.py @@ -8,7 +8,7 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# http://www.gnu.org/licenses/ +# https://www.gnu.org/licenses/ # **************************************************************************** from sage.rings.integer import Integer @@ -17,29 +17,6 @@ from sage.schemes.generic.scheme import Scheme -def is_AmbientSpace(x): - """ - Return ``True`` if `x` is an ambient space. - - EXAMPLES:: - - sage: from sage.schemes.generic.ambient_space import is_AmbientSpace - sage: is_AmbientSpace(ProjectiveSpace(3, ZZ)) - doctest:warning... - DeprecationWarning: The function is_AmbientSpace is deprecated; use 'isinstance(..., AmbientSpace)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - sage: is_AmbientSpace(AffineSpace(2, QQ)) - True - sage: P. = ProjectiveSpace(2, ZZ) - sage: is_AmbientSpace(P.subscheme([x + y + z])) - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_AmbientSpace is deprecated; use 'isinstance(..., AmbientSpace)' instead.") - return isinstance(x, AmbientSpace) - - class AmbientSpace(Scheme): """ Base class for ambient spaces over a ring. diff --git a/src/sage/schemes/generic/divisor_group.py b/src/sage/schemes/generic/divisor_group.py index 0b11b1d0982..3ff06b52667 100644 --- a/src/sage/schemes/generic/divisor_group.py +++ b/src/sage/schemes/generic/divisor_group.py @@ -58,33 +58,6 @@ def DivisorGroup(scheme, base_ring=None): return DG -def is_DivisorGroup(x): - r""" - Return whether ``x`` is a :class:`DivisorGroup_generic`. - - INPUT: - - - ``x`` -- anything - - OUTPUT: boolean - - EXAMPLES:: - - sage: from sage.schemes.generic.divisor_group import is_DivisorGroup, DivisorGroup - sage: Div = DivisorGroup(Spec(ZZ), base_ring=QQ) - sage: is_DivisorGroup(Div) - doctest:warning... - DeprecationWarning: The function is_DivisorGroup is deprecated; use 'isinstance(..., DivisorGroup_generic)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - sage: is_DivisorGroup('not a divisor') - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_DivisorGroup is deprecated; use 'isinstance(..., DivisorGroup_generic)' instead.") - return isinstance(x, DivisorGroup_generic) - - class DivisorGroup_generic(FormalSums): r""" The divisor group on a variety. @@ -104,7 +77,7 @@ def __classcall__(cls, scheme, base_ring=ZZ): # Must not call super().__classcall__()! return UniqueRepresentation.__classcall__(cls, scheme, base_ring) - def __init__(self, scheme, base_ring): + def __init__(self, scheme, base_ring) -> None: r""" Construct a :class:`DivisorGroup_generic`. diff --git a/src/sage/schemes/generic/homset.py b/src/sage/schemes/generic/homset.py index 071c0e8bd5e..be86b6b0b79 100644 --- a/src/sage/schemes/generic/homset.py +++ b/src/sage/schemes/generic/homset.py @@ -55,31 +55,6 @@ lazy_import('sage.schemes.projective.projective_space', 'ProjectiveSpace_ring', as_='ProjectiveSpace') -def is_SchemeHomset(H): - r""" - Test whether ``H`` is a scheme Hom-set. - - EXAMPLES:: - - sage: f = Spec(QQ).identity_morphism(); f - Scheme endomorphism of Spectrum of Rational Field - Defn: Identity map - sage: from sage.schemes.generic.homset import is_SchemeHomset - sage: is_SchemeHomset(f) - doctest:warning... - DeprecationWarning: The function is_SchemeHomset is deprecated; use 'isinstance(..., SchemeHomset_generic)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - False - sage: is_SchemeHomset(f.parent()) - True - sage: is_SchemeHomset('a string') - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_SchemeHomset is deprecated; use 'isinstance(..., SchemeHomset_generic)' instead.") - return isinstance(H, SchemeHomset_generic) - - # ******************************************************************* # Factory for Hom sets of schemes # ******************************************************************* diff --git a/src/sage/schemes/generic/hypersurface.py b/src/sage/schemes/generic/hypersurface.py index a6bb63040b5..fd574061ff8 100644 --- a/src/sage/schemes/generic/hypersurface.py +++ b/src/sage/schemes/generic/hypersurface.py @@ -9,54 +9,21 @@ - Alex Ghitza (2009-04-17) """ -#***************************************************************************** +# *************************************************************************** # Copyright (C) 2005 William Stein # # Distributed under the terms of the GNU General Public License (GPL) # # The full text of the GPL is available at: # -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# *************************************************************************** from sage.rings.polynomial.multi_polynomial import MPolynomial from sage.schemes.affine.affine_subscheme import AlgebraicScheme_subscheme_affine from sage.schemes.projective.projective_subscheme import AlgebraicScheme_subscheme_projective -def is_Hypersurface(self): - """ - Return ``True`` if ``self`` is a hypersurface, i.e. an object of the type - :class:`ProjectiveHypersurface` or :class:`AffineHypersurface`. - - EXAMPLES:: - - sage: from sage.schemes.generic.hypersurface import is_Hypersurface - sage: R. = ZZ[] - sage: H = ProjectiveHypersurface(x*z + y^2) - sage: is_Hypersurface(H) - doctest:warning... - DeprecationWarning: The function is_Hypersurface is deprecated; use 'isinstance(..., (ProjectiveHypersurface, AffineHypersurface))' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - - :: - - sage: H = AffineHypersurface(x*z + y^2) - sage: is_Hypersurface(H) - True - - :: - - sage: H = ProjectiveSpace(QQ, 5) - sage: is_Hypersurface(H) - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_Hypersurface is deprecated; use 'isinstance(..., (ProjectiveHypersurface, AffineHypersurface))' instead.") - return isinstance(self, (ProjectiveHypersurface, AffineHypersurface)) - - class ProjectiveHypersurface(AlgebraicScheme_subscheme_projective): """ The projective hypersurface defined by the given polynomial. diff --git a/src/sage/schemes/generic/scheme.py b/src/sage/schemes/generic/scheme.py index d9a9351e529..1d676e0953d 100644 --- a/src/sage/schemes/generic/scheme.py +++ b/src/sage/schemes/generic/scheme.py @@ -32,33 +32,6 @@ lazy_import('sage.schemes.elliptic_curves.ell_generic', 'EllipticCurve_generic', as_='EllipticCurve') -def is_Scheme(x): - """ - Test whether ``x`` is a scheme. - - INPUT: - - - ``x`` -- anything - - OUTPUT: boolean; whether ``x`` derives from :class:`Scheme` - - EXAMPLES:: - - sage: from sage.schemes.generic.scheme import is_Scheme - sage: is_Scheme(5) - doctest:warning... - DeprecationWarning: The function is_Scheme is deprecated; use 'isinstance(..., Scheme)' or categories instead. - See https://github.com/sagemath/sage/issues/38022 for details. - False - sage: X = Spec(QQ) - sage: is_Scheme(X) - True - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_Scheme is deprecated; use 'isinstance(..., Scheme)' or categories instead.") - return isinstance(x, Scheme) - - class Scheme(Parent): r""" The base class for all schemes. @@ -767,27 +740,6 @@ def zeta_series(self, n, t): return temp.exp() -def is_AffineScheme(x): - """ - Return ``True`` if `x` is an affine scheme. - - EXAMPLES:: - - sage: from sage.schemes.generic.scheme import is_AffineScheme - sage: is_AffineScheme(5) - doctest:warning... - DeprecationWarning: The function is_AffineScheme is deprecated; use 'isinstance(..., AffineScheme)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - False - sage: E = Spec(QQ) - sage: is_AffineScheme(E) - True - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_AffineScheme is deprecated; use 'isinstance(..., AffineScheme)' instead.") - return isinstance(x, AffineScheme) - - class AffineScheme(UniqueRepresentation, Scheme): """ Class for general affine schemes. diff --git a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py index 45b3c3ee952..ae8e5426ce7 100644 --- a/src/sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +++ b/src/sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py @@ -46,24 +46,6 @@ lazy_import("sage.functions.all", "log") -def is_HyperellipticCurve(C): - """ - EXAMPLES:: - - sage: from sage.schemes.hyperelliptic_curves.hyperelliptic_generic import is_HyperellipticCurve - sage: R. = QQ[]; C = HyperellipticCurve(x^3 + x - 1); C - Hyperelliptic Curve over Rational Field defined by y^2 = x^3 + x - 1 - sage: is_HyperellipticCurve(C) - doctest:warning... - DeprecationWarning: The function is_HyperellipticCurve is deprecated; use 'isinstance(..., HyperellipticCurve_generic)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_HyperellipticCurve is deprecated; use 'isinstance(..., HyperellipticCurve_generic)' instead.") - return isinstance(C, HyperellipticCurve_generic) - - class HyperellipticCurve_generic(plane_curve.ProjectivePlaneCurve): """ TESTS:: @@ -103,7 +85,7 @@ class HyperellipticCurve_generic(plane_curve.ProjectivePlaneCurve): sage: hash(C1) == hash(C2) False """ - def __init__(self, PP, f, h=None, names=None, genus=None): + def __init__(self, PP, f, h=None, names=None, genus=None) -> None: x, y, z = PP.gens() df = f.degree() F1 = sum([ f[i]*x**i*z**(df-i) for i in range(df+1) ]) diff --git a/src/sage/schemes/plane_quartics/quartic_generic.py b/src/sage/schemes/plane_quartics/quartic_generic.py index e41eb64d316..535ac40eecf 100644 --- a/src/sage/schemes/plane_quartics/quartic_generic.py +++ b/src/sage/schemes/plane_quartics/quartic_generic.py @@ -12,36 +12,16 @@ defined by X^4 + Y^4 - 3*X^2*Y*Z - 3*X*Y^2*Z - 3*X*Y*Z^2 + Z^4 """ -#***************************************************************************** +# *************************************************************************** # Copyright (C) 2006 David Kohel # Distributed under the terms of the GNU General Public License (GPL) # https://www.gnu.org/licenses/ -#***************************************************************************** +# *************************************************************************** import sage.schemes.curves.projective_curve as projective_curve -def is_QuarticCurve(C): - """ - Check whether ``C`` is a Quartic Curve. - - EXAMPLES:: - - sage: from sage.schemes.plane_quartics.quartic_generic import is_QuarticCurve - sage: x,y,z = PolynomialRing(QQ, ['x','y','z']).gens() - sage: Q = QuarticCurve(x**4 + y**4 + z**4) - sage: is_QuarticCurve(Q) - doctest:warning... - DeprecationWarning: The function is_QuarticCurve is deprecated; use 'isinstance(..., QuarticCurve_generic)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_QuarticCurve is deprecated; use 'isinstance(..., QuarticCurve_generic)' instead.") - return isinstance(C, QuarticCurve_generic) - - class QuarticCurve_generic(projective_curve.ProjectivePlaneCurve): # DRK: Note that we should check whether the curve is diff --git a/src/sage/schemes/product_projective/space.py b/src/sage/schemes/product_projective/space.py index d8d37b420ef..9b62bf8e51c 100644 --- a/src/sage/schemes/product_projective/space.py +++ b/src/sage/schemes/product_projective/space.py @@ -61,30 +61,6 @@ from sage.schemes.product_projective.subscheme import AlgebraicScheme_subscheme_product_projective -def is_ProductProjectiveSpaces(x): - r""" - Return ``True`` if ``x`` is a product of projective spaces. - - This is an ambient space defined by `\mathbb{P}^n_R \times \cdots \times \mathbb{P}^m_R`, - where `R` is a ring and `n,\ldots, m\geq 0` are integers. - - OUTPUT: boolean - - EXAMPLES:: - - sage: is_ProductProjectiveSpaces(ProjectiveSpace(5, names='x')) - doctest:warning... - DeprecationWarning: The function is_ProductProjectiveSpaces is deprecated; use 'isinstance(..., ProductProjectiveSpaces_ring)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - False - sage: is_ProductProjectiveSpaces(ProductProjectiveSpaces([1, 2, 3], ZZ, 'x')) - True - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_ProductProjectiveSpaces is deprecated; use 'isinstance(..., ProductProjectiveSpaces_ring)' instead.") - return isinstance(x, ProductProjectiveSpaces_ring) - - def ProductProjectiveSpaces(n, R=None, names='x'): r""" Return the Cartesian product of projective spaces. diff --git a/src/sage/schemes/projective/all.py b/src/sage/schemes/projective/all.py index b9e210c8ae0..5510abcaf87 100644 --- a/src/sage/schemes/projective/all.py +++ b/src/sage/schemes/projective/all.py @@ -20,4 +20,4 @@ # https://www.gnu.org/licenses/ # ***************************************************************************** -from sage.schemes.projective.projective_space import ProjectiveSpace, is_ProjectiveSpace +from sage.schemes.projective.projective_space import ProjectiveSpace diff --git a/src/sage/schemes/projective/projective_space.py b/src/sage/schemes/projective/projective_space.py index 9da4038ee3f..e6f94ac4873 100644 --- a/src/sage/schemes/projective/projective_space.py +++ b/src/sage/schemes/projective/projective_space.py @@ -134,31 +134,6 @@ _CommRings = _Rings.Commutative() -def is_ProjectiveSpace(x): - r""" - Return ``True`` if ``x`` is a projective space. - - In other words, if ``x`` is an ambient space `\mathbb{P}^n_R`, - where `R` is a ring and `n\geq 0` is an integer. - - EXAMPLES:: - - sage: from sage.schemes.projective.projective_space import is_ProjectiveSpace - sage: is_ProjectiveSpace(ProjectiveSpace(5, names='x')) - doctest:warning... - DeprecationWarning: The function is_ProjectiveSpace is deprecated; use 'isinstance(..., ProjectiveSpace_ring)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - sage: is_ProjectiveSpace(ProjectiveSpace(5, GF(9, 'alpha'), names='x')) # needs sage.rings.finite_rings - True - sage: is_ProjectiveSpace(Spec(ZZ)) - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_ProjectiveSpace is deprecated; use 'isinstance(..., ProjectiveSpace_ring)' instead.") - return isinstance(x, ProjectiveSpace_ring) - - def ProjectiveSpace(n, R=None, names=None): r""" Return projective space of dimension ``n`` over the ring ``R``. diff --git a/src/sage/schemes/toric/chow_group.py b/src/sage/schemes/toric/chow_group.py index 0b3bba42a2d..410f6ffaa4a 100644 --- a/src/sage/schemes/toric/chow_group.py +++ b/src/sage/schemes/toric/chow_group.py @@ -1047,7 +1047,7 @@ class ChowGroup_degree_class(SageObject): """ - def __init__(self, A, d): + def __init__(self, A, d) -> None: r""" Construct a :class:`ChowGroup_degree_class`. @@ -1184,64 +1184,3 @@ def gens(self) -> tuple: (( 0 | 0 | 1 ),) """ return self._gens - - -def is_ChowGroup(x) -> bool: - r""" - Return whether ``x`` is a :class:`ChowGroup_class`. - - INPUT: - - - ``x`` -- anything - - OUTPUT: boolean - - EXAMPLES:: - - sage: P2 = toric_varieties.P2() - sage: A = P2.Chow_group() - sage: from sage.schemes.toric.chow_group import is_ChowGroup - sage: is_ChowGroup(A) - doctest:warning... - DeprecationWarning: The function is_ChowGroup is deprecated; use 'isinstance(..., ChowGroup_class)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - True - sage: is_ChowGroup('Victoria') - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_ChowGroup is deprecated; use 'isinstance(..., ChowGroup_class)' instead.") - return isinstance(x, ChowGroup_class) - - -def is_ChowCycle(x) -> bool: - r""" - Return whether ``x`` is a :class:`ChowCycle`. - - INPUT: - - - ``x`` -- anything - - OUTPUT: boolean - - EXAMPLES:: - - sage: P2 = toric_varieties.P2() - sage: A = P2.Chow_group() - sage: from sage.schemes.toric.chow_group import * - sage: is_ChowCycle(A) - doctest:warning... - DeprecationWarning: The function is_ChowCycle is deprecated; - use 'isinstance(..., ChowCycle)' instead. - See https://github.com/sagemath/sage/issues/38277 for details. - False - sage: is_ChowCycle(A.an_element()) - True - sage: is_ChowCycle('Victoria') - False - """ - from sage.misc.superseded import deprecation - deprecation(38277, - "The function is_ChowCycle is deprecated; " - "use 'isinstance(..., ChowCycle)' instead.") - return isinstance(x, ChowCycle) diff --git a/src/sage/schemes/toric/fano_variety.py b/src/sage/schemes/toric/fano_variety.py index 355f7d593c1..4f614d06cf6 100644 --- a/src/sage/schemes/toric/fano_variety.py +++ b/src/sage/schemes/toric/fano_variety.py @@ -147,46 +147,6 @@ DEFAULT_COEFFICIENTS = tuple(chr(i) for i in range(ord("a"), ord("z") + 1)) -def is_CPRFanoToricVariety(x): - r""" - Check if ``x`` is a CPR-Fano toric variety. - - INPUT: - - - ``x`` -- anything - - OUTPUT: - - - ``True`` if ``x`` is a :class:`CPR-Fano toric variety - ` and ``False`` otherwise. - - .. NOTE:: - - While projective spaces are Fano toric varieties mathematically, they - are not toric varieties in Sage due to efficiency considerations, so - this function will return ``False``. - - EXAMPLES:: - - sage: from sage.schemes.toric.fano_variety import is_CPRFanoToricVariety - sage: is_CPRFanoToricVariety(1) - doctest:warning... - DeprecationWarning: The function is_CPRFanoToricVariety is deprecated; use 'isinstance(..., CPRFanoToricVariety_field)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - False - sage: FTV = toric_varieties.P2() - sage: FTV - 2-d CPR-Fano toric variety covered by 3 affine patches - sage: is_CPRFanoToricVariety(FTV) - True - sage: is_CPRFanoToricVariety(ProjectiveSpace(2)) - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_CPRFanoToricVariety is deprecated; use 'isinstance(..., CPRFanoToricVariety_field)' instead.") - return isinstance(x, CPRFanoToricVariety_field) - - def CPRFanoToricVariety(Delta=None, Delta_polar=None, coordinate_points=None, diff --git a/src/sage/schemes/toric/sheaf/klyachko.py b/src/sage/schemes/toric/sheaf/klyachko.py index f2d3629a9c9..2a18a4ae291 100644 --- a/src/sage/schemes/toric/sheaf/klyachko.py +++ b/src/sage/schemes/toric/sheaf/klyachko.py @@ -55,30 +55,6 @@ import sage.geometry.abc -def is_KlyachkoBundle(X): - """ - Test whether ``X`` is a Klyachko bundle. - - INPUT: - - - ``X`` -- anything - - OUTPUT: boolean - - EXAMPLES:: - - sage: from sage.schemes.toric.sheaf.klyachko import is_KlyachkoBundle - sage: is_KlyachkoBundle('test') - doctest:warning... - DeprecationWarning: The function is_KlyachkoBundle is deprecated; use 'isinstance(..., KlyachkoBundle_class)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_KlyachkoBundle is deprecated; use 'isinstance(..., KlyachkoBundle_class)' instead.") - return isinstance(X, KlyachkoBundle_class) - - def Bundle(toric_variety, multi_filtration, check=True): r""" Construct a Klyacho bundle. diff --git a/src/sage/schemes/toric/variety.py b/src/sage/schemes/toric/variety.py index 8bf6eb4c3d7..cec44cbdde5 100644 --- a/src/sage/schemes/toric/variety.py +++ b/src/sage/schemes/toric/variety.py @@ -336,47 +336,6 @@ DEFAULT_PREFIX = "z" -def is_ToricVariety(x): - r""" - Check if ``x`` is a toric variety. - - INPUT: - - - ``x`` -- anything - - OUTPUT: - - - ``True`` if ``x`` is a :class:`toric variety ` and - ``False`` otherwise. - - .. NOTE:: - - While projective spaces are toric varieties mathematically, they are - not toric varieties in Sage due to efficiency considerations, so this - function will return ``False``. - - EXAMPLES:: - - sage: from sage.schemes.toric.variety import is_ToricVariety - sage: is_ToricVariety(1) - doctest:warning... - DeprecationWarning: The function is_ToricVariety is deprecated; use 'isinstance(..., ToricVariety_field)' instead. - See https://github.com/sagemath/sage/issues/38022 for details. - False - sage: fan = FaceFan(lattice_polytope.cross_polytope(2)) - sage: P = ToricVariety(fan) - sage: P - 2-d toric variety covered by 4 affine patches - sage: is_ToricVariety(P) - True - sage: is_ToricVariety(ProjectiveSpace(2)) - False - """ - from sage.misc.superseded import deprecation - deprecation(38022, "The function is_ToricVariety is deprecated; use 'isinstance(..., ToricVariety_field)' instead.") - return isinstance(x, ToricVariety_field) - - def ToricVariety(fan, coordinate_names=None, names=None, @@ -3257,44 +3216,6 @@ def gen(self, i): return CohomologyClass(self, self._polynomial_ring.gen(i)) -# ***************************************************************** -def is_CohomologyClass(x): - r""" - Check whether ``x`` is a cohomology class of a toric variety. - - INPUT: - - - ``x`` -- anything - - OUTPUT: - - ``True`` or ``False`` depending on whether ``x`` is an instance of - :class:`CohomologyClass` - - EXAMPLES:: - - sage: P2 = toric_varieties.P2() - sage: HH = P2.cohomology_ring() - sage: from sage.schemes.toric.variety import is_CohomologyClass - sage: is_CohomologyClass( HH.one() ) # needs sage.libs.singular - doctest:warning... - DeprecationWarning: The function is_CohomologyClass is deprecated; - use 'isinstance(..., CohomologyClass)' instead. - See https://github.com/sagemath/sage/issues/38277 for details. - True - sage: is_CohomologyClass( HH(P2.fan(1)[0]) ) # needs sage.libs.singular - True - sage: is_CohomologyClass('z') - False - """ - from sage.misc.superseded import deprecation - deprecation(38277, - "The function is_CohomologyClass is deprecated; " - "use 'isinstance(..., CohomologyClass)' instead.") - return isinstance(x, CohomologyClass) - - -# ***************************************************************** class CohomologyClass(QuotientRingElement): r""" An element of the :class:`CohomologyRing`.