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 b  
    2121
    2222def is_Algebra(x):
    2323    r"""
    24     Return true if x is an Algebra
     24    Return True if x is an Algebra
    2525
    2626    EXAMPLES:
    27     sage: R.<x,y> = FreeAlgebra(QQ,2)
    28     sage: is_Algebra(R)
    29     True
     27        sage: from sage.algebras.algebra import is_Algebra
     28        sage: R.<x,y> = FreeAlgebra(QQ,2)
     29        sage: is_Algebra(R)
     30        True
    3031    """
    3132    return isinstance(x, Algebra)
  • sage/algebras/free_algebra.py

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/all.py
    a b  
    124124from sage.rings.qqbar import _init_qqbar
    125125_init_qqbar()
    126126
     127#Deprecate the is_* functions from the top level
     128#All of these functions should be removed from the top level
     129#after a few releases, and this code should be removed.
     130#--Mike Hansen 9/25/2008
     131globs = globals()
     132from functools import wraps, partial
     133for name,func in globs.items():
     134    if not name.startswith('is_') or not name[3].isupper():
     135        continue
     136
     137    def wrapper(func, name, *args, **kwds):
     138        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)
     139        return func(*args, **kwds)
     140
     141    globs[name] = partial(wrapper, func, name)
     142
     143del globs, wraps, partial
     144
     145
     146
     147
     148
    127149       
    128150###########################################################
    129151#### WARNING:
  • sage/calculus/calculus.py

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/calculus/calculus.py
    a b  
    310310def is_SymbolicExpression(x):
    311311    """
    312312    EXAMPLES:
     313        sage: from sage.calculus.calculus import is_SymbolicExpression
    313314        sage: is_SymbolicExpression(sin(x))
    314315        True
    315316        sage: is_SymbolicExpression(2/3)
     
    322323def is_SymbolicExpressionRing(x):
    323324    """
    324325    EXAMPLES:
     326        sage: from sage.calculus.calculus import is_SymbolicExpressionRing   
    325327        sage: is_SymbolicExpressionRing(QQ)
    326328        False
    327329        sage: is_SymbolicExpressionRing(SR)
     
    426428            Symbolic Ring
    427429            sage: type(SR(I))
    428430            <class 'sage.calculus.calculus.SymbolicConstant'>
     431            sage: from sage.calculus.calculus import is_SymbolicExpression
    429432            sage: is_SymbolicExpression(SR(I))
    430433            True
    431434
     
    52045207        bool -- True precisely if x is a symbolic variable.
    52055208
    52065209    EXAMPLES:
     5210        sage: from sage.calculus.calculus import is_SymbolicVariable
    52075211        sage: is_SymbolicVariable('x')
    52085212        False
    52095213        sage: is_SymbolicVariable(x)
     
    54215425        bool
    54225426   
    54235427    EXAMPLES:
     5428        sage: from sage.calculus.calculus import is_CallableSymbolicExpressionRing
    54245429        sage: is_CallableSymbolicExpressionRing(QQ)
    54255430        False
    54265431        sage: var('x,y,z')
     
    55575562    Returns true if \var{x} is a callable symbolic expression.
    55585563   
    55595564    EXAMPLES:
     5565        sage: from sage.calculus.calculus import is_CallableSymbolicExpression
    55605566        sage: var('a x y z')
    55615567        (a, x, y, z)
    55625568        sage: f(x,y) = a + 2*x + 3*y + z
  • sage/calculus/equations.py

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

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

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/abelian_gps/abelian_group.py
    a b  
    312312    Return True if $x$ is an abelian group.
    313313
    314314    EXAMPLES:
     315        sage: from sage.groups.abelian_gps.abelian_group import is_AbelianGroup
    315316        sage: F = AbelianGroup(5,[5,5,7,8,9],names = list("abcde")); F
    316317        Multiplicative Abelian Group isomorphic to C5 x C5 x C7 x C8 x C9
    317318        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 b  
    6060    EXAMPLES:
    6161    Though the integer 3 is in the integers, and the integers have an abelian
    6262    group structure, 3 is not an AbelianGroupElement:
     63         sage: from sage.groups.abelian_gps.abelian_group_element import is_AbelianGroupElement
    6364         sage: is_AbelianGroupElement(3)
    6465         False
    6566         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 b  
    9090    Return True if $x$ is the dual group of an abelian group.
    9191
    9292    EXAMPLES:
     93        sage: from sage.groups.abelian_gps.dual_abelian_group import is_DualAbelianGroup
    9394        sage: F = AbelianGroup(5,[3,5,7,8,9],names = list("abcde"))
    9495        sage: Fd = DualAbelianGroup(F)
    9596        sage: is_DualAbelianGroup(Fd)
  • sage/groups/matrix_gps/matrix_group.py

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/gap.py
    a b  
    10021002    Returns True if x is a GapElement.
    10031003
    10041004    EXAMPLES:
     1005        sage: from sage.interfaces.gap import is_GapElement
    10051006        sage: is_GapElement(gap(2))
    10061007        True
    10071008        sage: is_GapElement(2)
  • sage/interfaces/gp.py

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/gp.py
    a b  
    699699    Returns True of x is a GpElement.
    700700   
    701701    EXAMPLES:
     702        sage: from sage.interfaces.gp import is_GpElement
    702703        sage: is_GpElement(gp(2))
    703704        True
    704705        sage: is_GpElement(2)
  • sage/interfaces/r.py

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/r.py
    a b  
    18181818        bool
    18191819       
    18201820    EXAMPLES:
     1821        sage: from sage.interfaces.r import is_RElement
    18211822        sage: is_RElement(2)
    18221823        False
    18231824        sage: is_RElement(r(2))
  • sage/matrix/matrix.pyx

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/abvar/abvar.py
    a b  
    5555        x -- object
    5656
    5757    EXAMPLES:
     58        sage: from sage.modular.abvar.abvar import is_ModularAbelianVariety
    5859        sage: is_ModularAbelianVariety(5)
    5960        False
    6061        sage: is_ModularAbelianVariety(J0(37))
  • sage/modular/congroup.py

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/congroup.py
    a b  
    4242    Return True if x is of type CongruenceSubgroup.
    4343
    4444    EXAMPLES:
     45        sage: from sage.modular.congroup import is_CongruenceSubgroup
    4546        sage: is_CongruenceSubgroup(SL2Z)
    4647        True
    4748        sage: is_CongruenceSubgroup(Gamma0(13))
     
    532533    Return True if x is a congruence subgroup of type Gamma0.
    533534
    534535    EXAMPLES:
     536        sage: from sage.modular.congroup import is_Gamma0
    535537        sage: is_Gamma0(SL2Z)
    536538        True
    537539        sage: is_Gamma0(Gamma0(13))
     
    824826    Return True if x is the modular group ${\rm SL}_2(\Z)$.
    825827
    826828    EXAMPLES:
     829        sage: from sage.modular.congroup import is_SL2Z   
    827830        sage: is_SL2Z(SL2Z)
    828831        True
    829832        sage: is_SL2Z(Gamma0(6))
     
    932935    Return True if x is a congruence subgroup of type Gamma1.
    933936
    934937    EXAMPLES:
     938        sage: from sage.modular.congroup import is_Gamma1   
    935939        sage: is_Gamma1(SL2Z)
    936940        True
    937941        sage: is_Gamma1(Gamma1(13))
     
    11781182    Return True if x is a congruence subgroup of type GammaH.
    11791183
    11801184    EXAMPLES:
     1185        sage: from sage.modular.congroup import is_GammaH   
    11811186        sage: is_GammaH(GammaH(13, [2]))
    11821187        True
    11831188        sage: is_GammaH(Gamma0(6))
  • sage/modular/dirichlet.py

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

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/modules/free_module.py
    a b  
    427427    Return True if M inherits from from FreeModule_generic.
    428428
    429429    EXAMPLES:
     430        sage: from sage.modules.free_module import is_FreeModule
    430431        sage: V = ZZ^3
    431432        sage: is_FreeModule(V)
    432433        True
  • sage/modules/free_quadratic_module.py

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/modules/module.pyx
    a b  
    6767    Return True if x is a module.
    6868
    6969    EXAMPLES:
     70        sage: from sage.modules.module import is_Module
    7071        sage: M = FreeModule(RationalField(),30)
    7172        sage: is_Module(M)
    7273        True
     
    8081    Return True if x is a vector space.
    8182
    8283    EXAMPLES:
     84        sage: from sage.modules.module import is_Module, is_VectorSpace
    8385        sage: M = FreeModule(RationalField(),30)
    8486        sage: is_VectorSpace(M)
    8587        True
  • sage/monoids/free_abelian_monoid.py

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/plot/plot.py
    a b  
    288288    Return True if $x$ is a Graphics object.
    289289
    290290    EXAMPLES:
     291        sage: from sage.plot.plot import is_Graphics
    291292        sage: is_Graphics(1)
    292293        False
    293294        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 b  
    492492    """
    493493    Return True if x is a is_ComplexDoubleElement.
    494494   
    495     EXAMPLES:
     495    EXAMPLES:
     496        sage: from sage.rings.complex_double import is_ComplexDoubleElement
    496497        sage: is_ComplexDoubleElement(0)
    497498        False
    498499        sage: is_ComplexDoubleElement(CDF(0))
  • sage/rings/complex_number.pyx

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/finite_field_element.py
    a b  
    4040    Returns if x is a finite field element.
    4141
    4242    EXAMPLE:
     43        sage: from sage.rings.finite_field_element import is_FiniteFieldElement
    4344        sage: is_FiniteFieldElement(1)
    44             False
     45        False
    4546        sage: is_FiniteFieldElement(IntegerRing())
    46             False
     47        False
    4748        sage: is_FiniteFieldElement(GF(5)(2))
    48             True
     49        True
    4950       
    5051    """
    5152    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 b  
    11001100            sage: e.polynomial()
    11011101            a^15 + a^13 + a^11 + a^10 + a^9 + a^8 + a^7 + a^6 + a^4 + a + 1
    11021102
     1103            sage: from sage.rings.polynomial.polynomial_element import is_Polynomial
    11031104            sage: is_Polynomial(e.polynomial())
    11041105            True
    11051106           
  • sage/rings/fraction_field.py

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/fraction_field_element.py
    a b  
    3838    """
    3939    Returns whether or not x is of type FractionFieldElement
    4040   
    41     EXAMPLES:
     41    EXAMPLES:
     42        sage: from sage.rings.fraction_field_element import is_FractionFieldElement
    4243        sage: R.<x> = ZZ[]
    4344        sage: is_FractionFieldElement(x/2)
    4445        False
  • sage/rings/ideal.py

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

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

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field.py
    a b  
    456456        Number Field in a with defining polynomial x^2 - 9
    457457
    458458    Quadratic number fields derive from general number fields.
     459        sage: from sage.rings.number_field.number_field import is_NumberField
    459460        sage: type(K)
    460461        <class 'sage.rings.number_field.number_field.NumberField_quadratic'>
    461462        sage: is_NumberField(K)
     
    474475    Return True if x is an absolute number field.
    475476
    476477    EXAMPLES:
     478        sage: from sage.rings.number_field.number_field import is_AbsoluteNumberField   
    477479        sage: is_AbsoluteNumberField(NumberField(x^2+1,'a'))
    478480        True
    479481        sage: is_AbsoluteNumberField(NumberField([x^3 + 17, x^2+1],'a'))
     
    490492    Return True if x is of the quadratic \emph{number} field type.
    491493
    492494    EXAMPLES:
     495        sage: from sage.rings.number_field.number_field import is_QuadraticField
    493496        sage: is_QuadraticField(QuadraticField(5,'a'))
    494497        True
    495498        sage: is_QuadraticField(NumberField(x^2 - 5, 'b'))
     
    509512    Return True if x is a relative number field.
    510513
    511514    EXAMPLES:
     515        sage: from sage.rings.number_field.number_field import is_RelativeNumberField
    512516        sage: is_RelativeNumberField(NumberField(x^2+1,'a'))
    513517        False
    514518        sage: k.<a> = NumberField(x^3 - 2)
     
    608612    cyclotomic field.
    609613
    610614    EXAMPLES:
     615        sage: from sage.rings.number_field.number_field import is_CyclotomicField
    611616        sage: is_CyclotomicField(NumberField(x^2 + 1,'zeta4'))
    612617        False
    613618        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 b  
    1212    Return True if x is of number field type.
    1313
    1414    EXAMPLES:
     15        sage: from sage.rings.number_field.number_field_base import is_NumberField
    1516        sage: is_NumberField(NumberField(x^2+1,'a'))
    1617        True
    1718        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 b  
    6969    element of a number field.
    7070
    7171    EXAMPLES:
     72        sage: from sage.rings.number_field.number_field_element import is_NumberFieldElement
    7273        sage: is_NumberFieldElement(2)
    7374        False
    7475        sage: k.<a> = 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 b  
    773773    Return True if x is an ideal of a number field.
    774774
    775775    EXAMPLES:
     776        sage: from sage.rings.number_field.number_field_ideal import is_NumberFieldIdeal
    776777        sage: is_NumberFieldIdeal(2/3)
    777778        False
    778779        sage: is_NumberFieldIdeal(ideal(5))
     
    11121113    Return True if x is a fractional ideal of a number field.
    11131114
    11141115    EXAMPLES:
     1116        sage: from sage.rings.number_field.number_field_ideal import is_NumberFieldFractionalIdeal
    11151117        sage: is_NumberFieldFractionalIdeal(2/3)
    11161118        False
    11171119        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 b  
    172172    Return True if x is a fractional ideal of a relative number field.
    173173
    174174    EXAMPLES:
     175        sage: from sage.rings.number_field.number_field_ideal_rel import is_NumberFieldFractionalIdeal_rel
     176        sage: from sage.rings.number_field.number_field_ideal import is_NumberFieldFractionalIdeal
    175177        sage: is_NumberFieldFractionalIdeal_rel(2/3)
    176178        False
    177179        sage: is_NumberFieldFractionalIdeal_rel(ideal(5))
  • sage/rings/number_field/order.py

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

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/polynomial_element.pyx
    a b  
    7575        f -- an object
    7676
    7777    EXAMPLES:
     78        sage: from sage.rings.polynomial.polynomial_element import is_Polynomial
    7879        sage: R.<x> = ZZ[]
    7980        sage: is_Polynomial(x^3 + x + 1)
    8081        True
  • sage/rings/polynomial/polynomial_ring.py

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/polynomial_ring.py
    a b  
    104104    polynomial ring in one variable).
    105105
    106106    EXAMPLES:
     107        sage: from sage.rings.polynomial.polynomial_ring import is_PolynomialRing
     108        sage: from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing
    107109        sage: is_PolynomialRing(2)
    108110        False
    109111
  • sage/rings/power_series_ring.py

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/ring.pyx
    a b  
    12481248    Return True if x is a field.
    12491249
    12501250    EXAMPLES:
     1251        sage: from sage.rings.ring import is_Field
    12511252        sage: is_Field(QQ)
    12521253        True
    12531254        sage: is_Field(ZZ)
     
    20092010    Return True if x is of type finite field, and False otherwise.
    20102011
    20112012    EXAMPLES:
     2013        sage: from sage.rings.ring import is_FiniteField
    20122014        sage: is_FiniteField(GF(9,'a'))
    20132015        True
    20142016        sage: is_FiniteField(GF(next_prime(10^10)))
     
    20802082    Return true if x is a ring.
    20812083
    20822084    EXAMPLES:
     2085        sage: from sage.rings.ring import is_Ring
    20832086        sage: is_Ring(ZZ)
    20842087        True
    20852088    """
  • sage/schemes/elliptic_curves/ell_generic.py

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/elliptic_curves/ell_generic.py
    a b  
    8585def is_EllipticCurve(x):
    8686    """
    8787    EXAMPLES:
     88        sage: from sage.schemes.elliptic_curves.ell_generic import is_EllipticCurve
    8889        sage: E = EllipticCurve([1,2,3/4,7,19])
    8990        sage: is_EllipticCurve(E)
    9091        True
  • sage/schemes/generic/affine_space.py

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/affine_space.py
    a b  
    4141    $\A^n_R$, where $R$ is a ring and $n\geq 0$ is an integer.
    4242   
    4343    EXAMPLES:
     44        sage: from sage.schemes.generic.affine_space import is_AffineSpace
    4445        sage: is_AffineSpace(AffineSpace(5, names='x'))
    4546        True
    4647        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 b  
    4343    EXAMPLES:
    4444    Affine space is itself not an algebraic scheme, though the closed subscheme
    4545    defined by no equations is.
     46        sage: from sage.schemes.generic.algebraic_scheme import is_AlgebraicScheme
    4647        sage: is_AlgebraicScheme(AffineSpace(10, QQ))
    4748        False
    4849        sage: V = AffineSpace(10, QQ).subscheme([]); V
  • sage/schemes/generic/scheme.py

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/scheme.py
    a b  
    3838    Return True if $x$ is a scheme.
    3939
    4040    EXAMPLES:
     41        sage: from sage.schemes.generic.scheme import is_Scheme
    4142        sage: is_Scheme(5)
    4243        False
    4344        sage: X = Spec(QQ)
     
    501502    Return True if $x$ is an affine scheme.
    502503
    503504    EXAMPLES:
     505        sage: from sage.schemes.generic.scheme import is_AffineScheme
    504506        sage: is_AffineScheme(5)
    505507        False
    506508        sage: E = Spec(QQ)
  • sage/schemes/generic/spec.py

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

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

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/element.pyx
    a b  
    247247    Return True if x is of type Element.
    248248   
    249249    EXAMPLES:
     250        sage: from sage.structure.element import is_Element
    250251        sage: is_Element(2/3)
    251252        True
    252253        sage: is_Element(QQ^3)
     
    637638    This is even faster than using isinstance inline.
    638639
    639640    EXAMPLES:
     641        sage: from sage.structure.element import is_ModuleElement
    640642        sage: is_ModuleElement(2/3)
    641643        True
    642644        sage: is_ModuleElement((QQ^3).0)
  • sage/structure/parent.pyx

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent.pyx
    a b  
    9696    sage.structure.parent.Parent and False otherwise.
    9797
    9898    EXAMPLES:
     99        sage: from sage.structure.parent import is_Parent
    99100        sage: is_Parent(2/3)
    100101        False
    101102        sage: is_Parent(ZZ)
  • sage/structure/parent_gens.pyx

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent_gens.pyx
    a b  
    7373    from sage.structure.parent.ParentWithGens and False otherwise.
    7474   
    7575    EXAMPLES:
     76        sage: from sage.structure.parent_gens import is_ParentWithGens
    7677        sage: is_ParentWithGens(QQ['x'])
    7778        True
    7879        sage: is_ParentWithGens(CC)
     
    9091    otherwise.
    9192   
    9293    EXAMPLES:
     94        sage: from sage.structure.parent_gens import is_ParentWithAdditiveAbelianGens
    9395        sage: is_ParentWithAdditiveAbelianGens(QQ)
    9496        False
    9597        sage: is_ParentWithAdditiveAbelianGens(QQ^3)
     
    105107    otherwise.
    106108   
    107109    EXAMPLES:
     110        sage: from sage.structure.parent_gens import is_ParentWithMultiplicativeAbelianGens   
    108111        sage: is_ParentWithMultiplicativeAbelianGens(QQ)
    109112        False
    110113        sage: is_ParentWithMultiplicativeAbelianGens(DirichletGroup(11))
  • sage/structure/parent_old.pyx

    diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent_old.pyx
    a b  
    3030include '../ext/python_object.pxi'
    3131include '../ext/python_bool.pxi'
    3232include '../ext/stdsage.pxi'
    33 
    34 def is_Parent(x):
    35     """
    36     Return True if x is a parent object, i.e., derives from
    37     sage.structure.parent.Parent and False otherwise.
    38 
    39     EXAMPLES:
    40         sage: is_Parent(2/3)
    41         False
    42         sage: is_Parent(ZZ)
    43         True
    44         sage: is_Parent(Primes())
    45         True   
    46     """
    47     return PyBool_FromLong(PyObject_TypeCheck(x, Parent))
    4833   
    4934cdef inline check_old_coerce(Parent p):
    5035    if p._element_constructor is not None: