Ticket #4192: trac_4192.patch

File trac_4192.patch, 36.1 KB (added by mhansen, 14 years ago)
• sage/algebras/algebra.py

# HG changeset patch
# User Mike Hansen <mhansen@gmail.com>
# Date 1222412341 25200
# Node ID 727cf7cbc3502bf615263c91d737b05e6c87a863
# Parent  458d97c4b17c4bcbf7437e69c41d04e844aa2767
Deprecate the is_* functions from the top level.

diff -r 458d97c4b17c -r 727cf7cbc350 sage/algebras/algebra.py
 a def is_Algebra(x): r""" Return true if x is an Algebra Return True if x is an Algebra EXAMPLES: sage: R. = FreeAlgebra(QQ,2) sage: is_Algebra(R) True sage: from sage.algebras.algebra import is_Algebra sage: R. = FreeAlgebra(QQ,2) sage: is_Algebra(R) True """ return isinstance(x, Algebra)
• sage/algebras/free_algebra.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/algebras/free_algebra.py
 a Return True if x is a free algebra; otherwise, return False. EXAMPLES: sage: from sage.algebras.free_algebra import is_FreeAlgebra sage: is_FreeAlgebra(5) False sage: is_FreeAlgebra(ZZ)
• sage/all.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/all.py
 a from sage.rings.qqbar import _init_qqbar _init_qqbar() #Deprecate the is_* functions from the top level #All of these functions should be removed from the top level #after a few releases, and this code should be removed. #--Mike Hansen 9/25/2008 globs = globals() from functools import wraps, partial for name,func in globs.items(): if not name.startswith('is_') or not name[3].isupper(): continue def wrapper(func, name, *args, **kwds): sage.misc.misc.deprecation("\nUsing %s from the top level is deprecated since it was designed to be used by developers rather than end users.\nIt most likely does not do what you would expect it to do.  If you really need to use it, import it from the module that it is defined in."%name) return func(*args, **kwds) globs[name] = partial(wrapper, func, name) del globs, wraps, partial ########################################################### #### WARNING:
• sage/calculus/calculus.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/calculus/calculus.py
 a def is_SymbolicExpression(x): """ EXAMPLES: sage: from sage.calculus.calculus import is_SymbolicExpression sage: is_SymbolicExpression(sin(x)) True sage: is_SymbolicExpression(2/3) def is_SymbolicExpressionRing(x): """ EXAMPLES: sage: from sage.calculus.calculus import is_SymbolicExpressionRing sage: is_SymbolicExpressionRing(QQ) False sage: is_SymbolicExpressionRing(SR) Symbolic Ring sage: type(SR(I)) sage: from sage.calculus.calculus import is_SymbolicExpression sage: is_SymbolicExpression(SR(I)) True bool -- True precisely if x is a symbolic variable. EXAMPLES: sage: from sage.calculus.calculus import is_SymbolicVariable sage: is_SymbolicVariable('x') False sage: is_SymbolicVariable(x) bool EXAMPLES: sage: from sage.calculus.calculus import is_CallableSymbolicExpressionRing sage: is_CallableSymbolicExpressionRing(QQ) False sage: var('x,y,z') Returns true if \var{x} is a callable symbolic expression. EXAMPLES: sage: from sage.calculus.calculus import is_CallableSymbolicExpression sage: var('a x y z') (a, x, y, z) sage: f(x,y) = a + 2*x + 3*y + z
• sage/calculus/equations.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/calculus/equations.py
 a EXAMPLES: The following two examples are symbolic equations: sage: from sage.calculus.equations import is_SymbolicEquation sage: is_SymbolicEquation(sin(x) == x) True sage: is_SymbolicEquation(sin(x) < x)
• sage/categories/functor.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/categories/functor.pyx
 a Category of rings sage: F.codomain() Category of abelian groups sage: from sage.categories.functor import is_Functor sage: is_Functor(F) True sage: I = IdentityFunctor(abgrps)
• sage/categories/homset.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/categories/homset.py
 a sage: G = SymmetricGroup(3) sage: S = End(G); S Set of Morphisms from SymmetricGroup(3) to SymmetricGroup(3) in Category of groups sage: from sage.categories.homset import is_Endset sage: is_Endset(S) True sage: S.domain()
• sage/combinat/schubert_polynomial.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/combinat/schubert_polynomial.py
 a Returns True if x is a Schubert polynomial and False otherwise. EXAMPLES: sage: from sage.combinat.schubert_polynomial import is_SchubertPolynomial sage: X = SchubertPolynomialRing(ZZ) sage: a = 1 sage: is_SchubertPolynomial(a)
• sage/groups/abelian_gps/abelian_group.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/abelian_gps/abelian_group.py
 a Return True if $x$ is an abelian group. EXAMPLES: sage: from sage.groups.abelian_gps.abelian_group import is_AbelianGroup sage: F = AbelianGroup(5,[5,5,7,8,9],names = list("abcde")); F Multiplicative Abelian Group isomorphic to C5 x C5 x C7 x C8 x C9 sage: is_AbelianGroup(F)
• sage/groups/abelian_gps/abelian_group_element.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/abelian_gps/abelian_group_element.py
 a EXAMPLES: Though the integer 3 is in the integers, and the integers have an abelian group structure, 3 is not an AbelianGroupElement: sage: from sage.groups.abelian_gps.abelian_group_element import is_AbelianGroupElement sage: is_AbelianGroupElement(3) False sage: F = AbelianGroup(5, [3,4,5,8,7], 'abcde')
• sage/groups/abelian_gps/dual_abelian_group.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/abelian_gps/dual_abelian_group.py
 a Return True if $x$ is the dual group of an abelian group. EXAMPLES: sage: from sage.groups.abelian_gps.dual_abelian_group import is_DualAbelianGroup sage: F = AbelianGroup(5,[3,5,7,8,9],names = list("abcde")) sage: Fd = DualAbelianGroup(F) sage: is_DualAbelianGroup(Fd)
• sage/groups/matrix_gps/matrix_group.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/matrix_gps/matrix_group.py
 a def is_MatrixGroup(x): """ EXAMPLES: sage: from sage.groups.matrix_gps.matrix_group import is_MatrixGroup sage: is_MatrixGroup(MatrixSpace(QQ,3)) False sage: is_MatrixGroup(Mat(QQ,3))
• sage/interfaces/gap.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/gap.py
 a Returns True if x is a GapElement. EXAMPLES: sage: from sage.interfaces.gap import is_GapElement sage: is_GapElement(gap(2)) True sage: is_GapElement(2)
• sage/interfaces/gp.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/gp.py
 a Returns True of x is a GpElement. EXAMPLES: sage: from sage.interfaces.gp import is_GpElement sage: is_GpElement(gp(2)) True sage: is_GpElement(2)
• sage/interfaces/r.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/r.py
 a bool EXAMPLES: sage: from sage.interfaces.r import is_RElement sage: is_RElement(2) False sage: is_RElement(r(2))
• sage/matrix/matrix.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/matrix/matrix.pyx
 a def is_Matrix(x): """ EXAMPLES: sage: from sage.matrix.matrix import is_Matrix sage: is_Matrix(0) False sage: is_Matrix(matrix([[1,2],[3,4]]))
• sage/matrix/matrix_space.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/matrix/matrix_space.py
 a returns false if self is not an instance of MatrixSpace EXAMPLES: sage: from sage.matrix.matrix_space import is_MatrixSpace sage: MS = MatrixSpace(QQ,2) sage: A = MS.random_element() sage: is_MatrixSpace(MS)
• sage/modular/abvar/abvar.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/abvar/abvar.py
 a x -- object EXAMPLES: sage: from sage.modular.abvar.abvar import is_ModularAbelianVariety sage: is_ModularAbelianVariety(5) False sage: is_ModularAbelianVariety(J0(37))
• sage/modular/congroup.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/congroup.py
 a Return True if x is of type CongruenceSubgroup. EXAMPLES: sage: from sage.modular.congroup import is_CongruenceSubgroup sage: is_CongruenceSubgroup(SL2Z) True sage: is_CongruenceSubgroup(Gamma0(13)) Return True if x is a congruence subgroup of type Gamma0. EXAMPLES: sage: from sage.modular.congroup import is_Gamma0 sage: is_Gamma0(SL2Z) True sage: is_Gamma0(Gamma0(13)) Return True if x is the modular group ${\rm SL}_2(\Z)$. EXAMPLES: sage: from sage.modular.congroup import is_SL2Z sage: is_SL2Z(SL2Z) True sage: is_SL2Z(Gamma0(6)) Return True if x is a congruence subgroup of type Gamma1. EXAMPLES: sage: from sage.modular.congroup import is_Gamma1 sage: is_Gamma1(SL2Z) True sage: is_Gamma1(Gamma1(13)) Return True if x is a congruence subgroup of type GammaH. EXAMPLES: sage: from sage.modular.congroup import is_GammaH sage: is_GammaH(GammaH(13, [2])) True sage: is_GammaH(Gamma0(6))
• sage/modular/dirichlet.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/dirichlet.py
 a Returns True if x is a Dirichlet group. EXAMPLES: sage: from sage.modular.dirichlet import is_DirichletGroup sage: is_DirichletGroup(DirichletGroup(11)) True sage: is_DirichletGroup(11)
• sage/modular/modform/element.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/modform/element.py
 a Return True if x is a modular form. EXAMPLES: sage: from sage.modular.modform.element import is_ModularFormElement sage: is_ModularFormElement(5) False sage: is_ModularFormElement(ModularForms(11).0)
• sage/modular/modform/space.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/modform/space.py
 a Return True if x is a $\code{ModularFormsSpace}$. EXAMPLES: sage: from sage.modular.modform.space import is_ModularFormsSpace sage: is_ModularFormsSpace(ModularForms(11,2)) True sage: is_ModularFormsSpace(CuspForms(11,2))
• sage/modules/free_module.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/modules/free_module.py
 a Return True if M inherits from from FreeModule_generic. EXAMPLES: sage: from sage.modules.free_module import is_FreeModule sage: V = ZZ^3 sage: is_FreeModule(V) True

diff -r 458d97c4b17c -r 727cf7cbc350 sage/modules/free_quadratic_module.py
 a Returns True if M is a free quadratic module. EXAMPLES: sage: from sage.modules.free_quadratic_module import is_FreeQuadraticModule sage: U = FreeModule(QQ,3) sage: is_FreeQuadraticModule(U) False
• sage/modules/module.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/modules/module.pyx
 a Return True if x is a module. EXAMPLES: sage: from sage.modules.module import is_Module sage: M = FreeModule(RationalField(),30) sage: is_Module(M) True Return True if x is a vector space. EXAMPLES: sage: from sage.modules.module import is_Module, is_VectorSpace sage: M = FreeModule(RationalField(),30) sage: is_VectorSpace(M) True
• sage/monoids/free_abelian_monoid.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/monoids/free_abelian_monoid.py
 a Return True if $x$ is a free abelian monoid. EXAMPLES: sage: from sage.monoids.free_abelian_monoid import is_FreeAbelianMonoid sage: is_FreeAbelianMonoid(5) False sage: is_FreeAbelianMonoid(FreeAbelianMonoid(7,'a'))
• sage/monoids/free_monoid.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/monoids/free_monoid.py
 a Return True if $x$ is a free monoid. EXAMPLES: sage: from sage.monoids.free_monoid import is_FreeMonoid sage: is_FreeMonoid(5) False sage: is_FreeMonoid(FreeMonoid(7,'a'))
• sage/plot/plot.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/plot/plot.py
 a Return True if $x$ is a Graphics object. EXAMPLES: sage: from sage.plot.plot import is_Graphics sage: is_Graphics(1) False sage: is_Graphics(disk((0.0, 0.0), 1, (0, pi/2)))
• sage/rings/complex_double.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/complex_double.pyx
 a """ Return True if x is a is_ComplexDoubleElement. EXAMPLES: EXAMPLES: sage: from sage.rings.complex_double import is_ComplexDoubleElement sage: is_ComplexDoubleElement(0) False sage: is_ComplexDoubleElement(CDF(0))
• sage/rings/complex_number.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/complex_number.pyx
 a \code{ComplexNumber} type. EXAMPLES: sage: from sage.rings.complex_number import is_ComplexNumber sage: a = ComplexNumber(1,2); a 1.00000000000000 + 2.00000000000000*I sage: is_ComplexNumber(a)
• sage/rings/finite_field.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/finite_field.py
 a Returns True if x is a prime finite field. EXAMPLES: sage: from sage.rings.finite_field import is_PrimeFiniteField sage: is_PrimeFiniteField(QQ) False sage: is_PrimeFiniteField(GF(7))
• sage/rings/finite_field_element.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/finite_field_element.py
 a Returns if x is a finite field element. EXAMPLE: sage: from sage.rings.finite_field_element import is_FiniteFieldElement sage: is_FiniteFieldElement(1) False False sage: is_FiniteFieldElement(IntegerRing()) False False sage: is_FiniteFieldElement(GF(5)(2)) True True """ return isinstance(x, element.Element) and ring.is_FiniteField(x.parent())
• sage/rings/finite_field_ntl_gf2e.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/finite_field_ntl_gf2e.pyx
 a sage: e.polynomial() a^15 + a^13 + a^11 + a^10 + a^9 + a^8 + a^7 + a^6 + a^4 + a + 1 sage: from sage.rings.polynomial.polynomial_element import is_Polynomial sage: is_Polynomial(e.polynomial()) True
• sage/rings/fraction_field.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/fraction_field.py
 a """ Tests whether or not x inherits from FractionField_generic. EXAMPLES: EXAMPLES: sage: from sage.rings.fraction_field import is_FractionField sage: is_FractionField(Frac(ZZ['x'])) True sage: is_FractionField(QQ)
• sage/rings/fraction_field_element.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/fraction_field_element.py
 a """ Returns whether or not x is of type FractionFieldElement EXAMPLES: EXAMPLES: sage: from sage.rings.fraction_field_element import is_FractionFieldElement sage: R. = ZZ[] sage: is_FractionFieldElement(x/2) False
• sage/rings/ideal.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/ideal.py
 a A simple example involving the ring of integers. Note that SAGE does not interpret rings objects themselves as ideals. However, one can still explicitly construct these ideals: sage: from sage.rings.ideal import is_Ideal sage: R = ZZ sage: is_Ideal(R) False
• sage/rings/integer.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/integer.pyx
 a Return true if x is of the SAGE integer type. EXAMPLES: sage: from sage.rings.integer import is_Integer sage: is_Integer(2) True sage: is_Integer(2/1)
• sage/rings/integer_mod.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/integer_mod.pyx
 a Return \code{True} if and only if x is an integer modulo $n$. EXAMPLES: sage: from sage.rings.integer_mod import is_IntegerMod sage: is_IntegerMod(5) False sage: is_IntegerMod(Mod(5,10))
• sage/rings/integer_mod_ring.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/integer_mod_ring.py
 a Return True if x is an integer modulo ring. EXAMPLES: sage: from sage.rings.integer_mod_ring import is_IntegerModRing sage: R = IntegerModRing(17) sage: is_IntegerModRing(R) True
• sage/rings/number_field/number_field.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field.py
 a Number Field in a with defining polynomial x^2 - 9 Quadratic number fields derive from general number fields. sage: from sage.rings.number_field.number_field import is_NumberField sage: type(K) sage: is_NumberField(K) Return True if x is an absolute number field. EXAMPLES: sage: from sage.rings.number_field.number_field import is_AbsoluteNumberField sage: is_AbsoluteNumberField(NumberField(x^2+1,'a')) True sage: is_AbsoluteNumberField(NumberField([x^3 + 17, x^2+1],'a')) Return True if x is of the quadratic \emph{number} field type. EXAMPLES: sage: from sage.rings.number_field.number_field import is_QuadraticField sage: is_QuadraticField(QuadraticField(5,'a')) True sage: is_QuadraticField(NumberField(x^2 - 5, 'b')) Return True if x is a relative number field. EXAMPLES: sage: from sage.rings.number_field.number_field import is_RelativeNumberField sage: is_RelativeNumberField(NumberField(x^2+1,'a')) False sage: k. = NumberField(x^3 - 2) cyclotomic field. EXAMPLES: sage: from sage.rings.number_field.number_field import is_CyclotomicField sage: is_CyclotomicField(NumberField(x^2 + 1,'zeta4')) False sage: is_CyclotomicField(CyclotomicField(4))
• sage/rings/number_field/number_field_base.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field_base.pyx
 a Return True if x is of number field type. EXAMPLES: sage: from sage.rings.number_field.number_field_base import is_NumberField sage: is_NumberField(NumberField(x^2+1,'a')) True sage: is_NumberField(QuadraticField(-97,'theta'))
• sage/rings/number_field/number_field_element.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field_element.pyx
 a element of a number field. EXAMPLES: sage: from sage.rings.number_field.number_field_element import is_NumberFieldElement sage: is_NumberFieldElement(2) False sage: k. = NumberField(x^7 + 17*x + 1)
• sage/rings/number_field/number_field_ideal.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field_ideal.py
 a Return True if x is an ideal of a number field. EXAMPLES: sage: from sage.rings.number_field.number_field_ideal import is_NumberFieldIdeal sage: is_NumberFieldIdeal(2/3) False sage: is_NumberFieldIdeal(ideal(5)) Return True if x is a fractional ideal of a number field. EXAMPLES: sage: from sage.rings.number_field.number_field_ideal import is_NumberFieldFractionalIdeal sage: is_NumberFieldFractionalIdeal(2/3) False sage: is_NumberFieldFractionalIdeal(ideal(5))
• sage/rings/number_field/number_field_ideal_rel.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field_ideal_rel.py
 a Return True if x is a fractional ideal of a relative number field. EXAMPLES: sage: from sage.rings.number_field.number_field_ideal_rel import is_NumberFieldFractionalIdeal_rel sage: from sage.rings.number_field.number_field_ideal import is_NumberFieldFractionalIdeal sage: is_NumberFieldFractionalIdeal_rel(2/3) False sage: is_NumberFieldFractionalIdeal_rel(ideal(5))
• sage/rings/number_field/order.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/order.py
 a Return True if R an order in a number field or R is the ring ZZ of integers. EXAMPLES: sage: from sage.rings.number_field.order import is_NumberFieldOrder sage: is_NumberFieldOrder(NumberField(x^2+1,'a').maximal_order()) True sage: is_NumberFieldOrder(ZZ)
• sage/rings/polynomial/laurent_polynomial_ring.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/laurent_polynomial_ring.py
 a Returns True if and only if R is a Laurent polynomial ring. EXAMPLES: sage: from sage.rings.polynomial.laurent_polynomial_ring import is_LaurentPolynomialRing sage: P = PolynomialRing(QQ,2,'x') sage: is_LaurentPolynomialRing(P) False
• sage/rings/polynomial/multi_polynomial_ideal.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/multi_polynomial_ideal.py
 a INPUT: x -- an arbitrary object EXAMPLE: EXAMPLES: sage: from sage.rings.polynomial.all import is_MPolynomialIdeal sage: P. = PolynomialRing(QQ) sage: I = [x + 2*y + 2*z - 1, x^2 + 2*y^2 + 2*z^2 - x, 2*x*y + 2*y*z - y]
• sage/rings/polynomial/polynomial_element.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/polynomial_element.pyx
 a f -- an object EXAMPLES: sage: from sage.rings.polynomial.polynomial_element import is_Polynomial sage: R. = ZZ[] sage: is_Polynomial(x^3 + x + 1) True
• sage/rings/polynomial/polynomial_ring.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/polynomial_ring.py
 a polynomial ring in one variable). EXAMPLES: sage: from sage.rings.polynomial.polynomial_ring import is_PolynomialRing sage: from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing sage: is_PolynomialRing(2) False
• sage/rings/power_series_ring.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/power_series_ring.py
 a Return True if R is a power series ring. EXAMPLES: sage: from sage.rings.power_series_ring import is_PowerSeriesRing sage: is_PowerSeriesRing(10) False sage: is_PowerSeriesRing(QQ[['x']])
• sage/rings/real_mpfr.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/real_mpfr.pyx
 a element of the MPFR real field with some precision. EXAMPLES: sage: from sage.rings.real_mpfr import is_RealNumber sage: is_RealNumber(2.5) True sage: is_RealNumber(float(2.3))
• sage/rings/ring.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/ring.pyx
 a Return True if x is a field. EXAMPLES: sage: from sage.rings.ring import is_Field sage: is_Field(QQ) True sage: is_Field(ZZ) Return True if x is of type finite field, and False otherwise. EXAMPLES: sage: from sage.rings.ring import is_FiniteField sage: is_FiniteField(GF(9,'a')) True sage: is_FiniteField(GF(next_prime(10^10))) Return true if x is a ring. EXAMPLES: sage: from sage.rings.ring import is_Ring sage: is_Ring(ZZ) True """
• sage/schemes/elliptic_curves/ell_generic.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/elliptic_curves/ell_generic.py
 a def is_EllipticCurve(x): """ 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) True
• sage/schemes/generic/affine_space.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/affine_space.py
 a $\A^n_R$, where $R$ is a ring and $n\geq 0$ is an integer. EXAMPLES: sage: from sage.schemes.generic.affine_space import is_AffineSpace sage: is_AffineSpace(AffineSpace(5, names='x')) True sage: is_AffineSpace(AffineSpace(5, GF(9,'alpha'), names='x'))
• sage/schemes/generic/algebraic_scheme.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/algebraic_scheme.py
 a EXAMPLES: 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
• sage/schemes/generic/scheme.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/scheme.py
 a Return True if $x$ is a scheme. EXAMPLES: sage: from sage.schemes.generic.scheme import is_Scheme sage: is_Scheme(5) False sage: X = Spec(QQ) Return True if $x$ is an affine scheme. EXAMPLES: sage: from sage.schemes.generic.scheme import is_AffineScheme sage: is_AffineScheme(5) False sage: E = Spec(QQ)
• sage/schemes/generic/spec.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/spec.py
 a def is_Spec(X): """ EXAMPLES: sage: from sage.schemes.generic.spec import is_Spec sage: is_Spec(QQ^3) False sage: X = Spec(QQ); X
• sage/sets/set.py

diff -r 458d97c4b17c -r 727cf7cbc350 sage/sets/set.py
 a def is_Set(x): """ Returns true if $x$ is a SAGE Set (not to be confused with Returns true if $x$ is a Sage Set (not to be confused with a Python 2.4 set). EXAMPLES: sage: from sage.sets.set import is_Set sage: is_Set([1,2,3]) False sage: is_Set(set([1,2,3]))
• sage/structure/element.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/element.pyx
 a Return True if x is of type Element. EXAMPLES: sage: from sage.structure.element import is_Element sage: is_Element(2/3) True sage: is_Element(QQ^3) This is even faster than using isinstance inline. EXAMPLES: sage: from sage.structure.element import is_ModuleElement sage: is_ModuleElement(2/3) True sage: is_ModuleElement((QQ^3).0)
• sage/structure/parent.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent.pyx
 a sage.structure.parent.Parent and False otherwise. EXAMPLES: sage: from sage.structure.parent import is_Parent sage: is_Parent(2/3) False sage: is_Parent(ZZ)
• sage/structure/parent_gens.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent_gens.pyx
 a from sage.structure.parent.ParentWithGens and False otherwise. EXAMPLES: sage: from sage.structure.parent_gens import is_ParentWithGens sage: is_ParentWithGens(QQ['x']) True sage: is_ParentWithGens(CC) otherwise. EXAMPLES: sage: from sage.structure.parent_gens import is_ParentWithAdditiveAbelianGens sage: is_ParentWithAdditiveAbelianGens(QQ) False sage: is_ParentWithAdditiveAbelianGens(QQ^3) otherwise. EXAMPLES: sage: from sage.structure.parent_gens import is_ParentWithMultiplicativeAbelianGens sage: is_ParentWithMultiplicativeAbelianGens(QQ) False sage: is_ParentWithMultiplicativeAbelianGens(DirichletGroup(11))
• sage/structure/parent_old.pyx

diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent_old.pyx
 a include '../ext/python_object.pxi' include '../ext/python_bool.pxi' include '../ext/stdsage.pxi' def is_Parent(x): """ Return True if x is a parent object, i.e., derives from sage.structure.parent.Parent and False otherwise. EXAMPLES: sage: is_Parent(2/3) False sage: is_Parent(ZZ) True sage: is_Parent(Primes()) True """ return PyBool_FromLong(PyObject_TypeCheck(x, Parent)) cdef inline check_old_coerce(Parent p): if p._element_constructor is not None: