-
# 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
|
|
21 | 21 | |
22 | 22 | def is_Algebra(x): |
23 | 23 | r""" |
24 | | Return true if x is an Algebra |
| 24 | Return True if x is an Algebra |
25 | 25 | |
26 | 26 | 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 |
30 | 31 | """ |
31 | 32 | return isinstance(x, Algebra) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/algebras/free_algebra.py
a
|
b
|
|
114 | 114 | Return True if x is a free algebra; otherwise, return False. |
115 | 115 | |
116 | 116 | EXAMPLES: |
| 117 | sage: from sage.algebras.free_algebra import is_FreeAlgebra |
117 | 118 | sage: is_FreeAlgebra(5) |
118 | 119 | False |
119 | 120 | sage: is_FreeAlgebra(ZZ) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/all.py
a
|
b
|
|
124 | 124 | from sage.rings.qqbar import _init_qqbar |
125 | 125 | _init_qqbar() |
126 | 126 | |
| 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 |
| 131 | globs = globals() |
| 132 | from functools import wraps, partial |
| 133 | for 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 | |
| 143 | del globs, wraps, partial |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
127 | 149 | |
128 | 150 | ########################################################### |
129 | 151 | #### WARNING: |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/calculus/calculus.py
a
|
b
|
|
310 | 310 | def is_SymbolicExpression(x): |
311 | 311 | """ |
312 | 312 | EXAMPLES: |
| 313 | sage: from sage.calculus.calculus import is_SymbolicExpression |
313 | 314 | sage: is_SymbolicExpression(sin(x)) |
314 | 315 | True |
315 | 316 | sage: is_SymbolicExpression(2/3) |
… |
… |
|
322 | 323 | def is_SymbolicExpressionRing(x): |
323 | 324 | """ |
324 | 325 | EXAMPLES: |
| 326 | sage: from sage.calculus.calculus import is_SymbolicExpressionRing |
325 | 327 | sage: is_SymbolicExpressionRing(QQ) |
326 | 328 | False |
327 | 329 | sage: is_SymbolicExpressionRing(SR) |
… |
… |
|
426 | 428 | Symbolic Ring |
427 | 429 | sage: type(SR(I)) |
428 | 430 | <class 'sage.calculus.calculus.SymbolicConstant'> |
| 431 | sage: from sage.calculus.calculus import is_SymbolicExpression |
429 | 432 | sage: is_SymbolicExpression(SR(I)) |
430 | 433 | True |
431 | 434 | |
… |
… |
|
5204 | 5207 | bool -- True precisely if x is a symbolic variable. |
5205 | 5208 | |
5206 | 5209 | EXAMPLES: |
| 5210 | sage: from sage.calculus.calculus import is_SymbolicVariable |
5207 | 5211 | sage: is_SymbolicVariable('x') |
5208 | 5212 | False |
5209 | 5213 | sage: is_SymbolicVariable(x) |
… |
… |
|
5421 | 5425 | bool |
5422 | 5426 | |
5423 | 5427 | EXAMPLES: |
| 5428 | sage: from sage.calculus.calculus import is_CallableSymbolicExpressionRing |
5424 | 5429 | sage: is_CallableSymbolicExpressionRing(QQ) |
5425 | 5430 | False |
5426 | 5431 | sage: var('x,y,z') |
… |
… |
|
5557 | 5562 | Returns true if \var{x} is a callable symbolic expression. |
5558 | 5563 | |
5559 | 5564 | EXAMPLES: |
| 5565 | sage: from sage.calculus.calculus import is_CallableSymbolicExpression |
5560 | 5566 | sage: var('a x y z') |
5561 | 5567 | (a, x, y, z) |
5562 | 5568 | sage: f(x,y) = a + 2*x + 3*y + z |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/calculus/equations.py
a
|
b
|
|
129 | 129 | |
130 | 130 | EXAMPLES: |
131 | 131 | The following two examples are symbolic equations: |
| 132 | sage: from sage.calculus.equations import is_SymbolicEquation |
132 | 133 | sage: is_SymbolicEquation(sin(x) == x) |
133 | 134 | True |
134 | 135 | sage: is_SymbolicEquation(sin(x) < x) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/categories/functor.pyx
a
|
b
|
|
35 | 35 | Category of rings |
36 | 36 | sage: F.codomain() |
37 | 37 | Category of abelian groups |
| 38 | sage: from sage.categories.functor import is_Functor |
38 | 39 | sage: is_Functor(F) |
39 | 40 | True |
40 | 41 | sage: I = IdentityFunctor(abgrps) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/categories/homset.py
a
|
b
|
|
187 | 187 | sage: G = SymmetricGroup(3) |
188 | 188 | sage: S = End(G); S |
189 | 189 | Set of Morphisms from SymmetricGroup(3) to SymmetricGroup(3) in Category of groups |
| 190 | sage: from sage.categories.homset import is_Endset |
190 | 191 | sage: is_Endset(S) |
191 | 192 | True |
192 | 193 | sage: S.domain() |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/combinat/schubert_polynomial.py
a
|
b
|
|
47 | 47 | Returns True if x is a Schubert polynomial and False otherwise. |
48 | 48 | |
49 | 49 | EXAMPLES: |
| 50 | sage: from sage.combinat.schubert_polynomial import is_SchubertPolynomial |
50 | 51 | sage: X = SchubertPolynomialRing(ZZ) |
51 | 52 | sage: a = 1 |
52 | 53 | sage: is_SchubertPolynomial(a) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/abelian_gps/abelian_group.py
a
|
b
|
|
312 | 312 | Return True if $x$ is an abelian group. |
313 | 313 | |
314 | 314 | EXAMPLES: |
| 315 | sage: from sage.groups.abelian_gps.abelian_group import is_AbelianGroup |
315 | 316 | sage: F = AbelianGroup(5,[5,5,7,8,9],names = list("abcde")); F |
316 | 317 | Multiplicative Abelian Group isomorphic to C5 x C5 x C7 x C8 x C9 |
317 | 318 | sage: is_AbelianGroup(F) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/abelian_gps/abelian_group_element.py
a
|
b
|
|
60 | 60 | EXAMPLES: |
61 | 61 | Though the integer 3 is in the integers, and the integers have an abelian |
62 | 62 | group structure, 3 is not an AbelianGroupElement: |
| 63 | sage: from sage.groups.abelian_gps.abelian_group_element import is_AbelianGroupElement |
63 | 64 | sage: is_AbelianGroupElement(3) |
64 | 65 | False |
65 | 66 | sage: F = AbelianGroup(5, [3,4,5,8,7], 'abcde') |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/abelian_gps/dual_abelian_group.py
a
|
b
|
|
90 | 90 | Return True if $x$ is the dual group of an abelian group. |
91 | 91 | |
92 | 92 | EXAMPLES: |
| 93 | sage: from sage.groups.abelian_gps.dual_abelian_group import is_DualAbelianGroup |
93 | 94 | sage: F = AbelianGroup(5,[3,5,7,8,9],names = list("abcde")) |
94 | 95 | sage: Fd = DualAbelianGroup(F) |
95 | 96 | sage: is_DualAbelianGroup(Fd) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/groups/matrix_gps/matrix_group.py
a
|
b
|
|
82 | 82 | def is_MatrixGroup(x): |
83 | 83 | """ |
84 | 84 | EXAMPLES: |
| 85 | sage: from sage.groups.matrix_gps.matrix_group import is_MatrixGroup |
85 | 86 | sage: is_MatrixGroup(MatrixSpace(QQ,3)) |
86 | 87 | False |
87 | 88 | sage: is_MatrixGroup(Mat(QQ,3)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/gap.py
a
|
b
|
|
1002 | 1002 | Returns True if x is a GapElement. |
1003 | 1003 | |
1004 | 1004 | EXAMPLES: |
| 1005 | sage: from sage.interfaces.gap import is_GapElement |
1005 | 1006 | sage: is_GapElement(gap(2)) |
1006 | 1007 | True |
1007 | 1008 | sage: is_GapElement(2) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/gp.py
a
|
b
|
|
699 | 699 | Returns True of x is a GpElement. |
700 | 700 | |
701 | 701 | EXAMPLES: |
| 702 | sage: from sage.interfaces.gp import is_GpElement |
702 | 703 | sage: is_GpElement(gp(2)) |
703 | 704 | True |
704 | 705 | sage: is_GpElement(2) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/interfaces/r.py
a
|
b
|
|
1818 | 1818 | bool |
1819 | 1819 | |
1820 | 1820 | EXAMPLES: |
| 1821 | sage: from sage.interfaces.r import is_RElement |
1821 | 1822 | sage: is_RElement(2) |
1822 | 1823 | False |
1823 | 1824 | sage: is_RElement(r(2)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/matrix/matrix.pyx
a
|
b
|
|
18 | 18 | def is_Matrix(x): |
19 | 19 | """ |
20 | 20 | EXAMPLES: |
| 21 | sage: from sage.matrix.matrix import is_Matrix |
21 | 22 | sage: is_Matrix(0) |
22 | 23 | False |
23 | 24 | sage: is_Matrix(matrix([[1,2],[3,4]])) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/matrix/matrix_space.py
a
|
b
|
|
89 | 89 | returns false if self is not an instance of MatrixSpace |
90 | 90 | |
91 | 91 | EXAMPLES: |
| 92 | sage: from sage.matrix.matrix_space import is_MatrixSpace |
92 | 93 | sage: MS = MatrixSpace(QQ,2) |
93 | 94 | sage: A = MS.random_element() |
94 | 95 | sage: is_MatrixSpace(MS) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/abvar/abvar.py
a
|
b
|
|
55 | 55 | x -- object |
56 | 56 | |
57 | 57 | EXAMPLES: |
| 58 | sage: from sage.modular.abvar.abvar import is_ModularAbelianVariety |
58 | 59 | sage: is_ModularAbelianVariety(5) |
59 | 60 | False |
60 | 61 | sage: is_ModularAbelianVariety(J0(37)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/congroup.py
a
|
b
|
|
42 | 42 | Return True if x is of type CongruenceSubgroup. |
43 | 43 | |
44 | 44 | EXAMPLES: |
| 45 | sage: from sage.modular.congroup import is_CongruenceSubgroup |
45 | 46 | sage: is_CongruenceSubgroup(SL2Z) |
46 | 47 | True |
47 | 48 | sage: is_CongruenceSubgroup(Gamma0(13)) |
… |
… |
|
532 | 533 | Return True if x is a congruence subgroup of type Gamma0. |
533 | 534 | |
534 | 535 | EXAMPLES: |
| 536 | sage: from sage.modular.congroup import is_Gamma0 |
535 | 537 | sage: is_Gamma0(SL2Z) |
536 | 538 | True |
537 | 539 | sage: is_Gamma0(Gamma0(13)) |
… |
… |
|
824 | 826 | Return True if x is the modular group ${\rm SL}_2(\Z)$. |
825 | 827 | |
826 | 828 | EXAMPLES: |
| 829 | sage: from sage.modular.congroup import is_SL2Z |
827 | 830 | sage: is_SL2Z(SL2Z) |
828 | 831 | True |
829 | 832 | sage: is_SL2Z(Gamma0(6)) |
… |
… |
|
932 | 935 | Return True if x is a congruence subgroup of type Gamma1. |
933 | 936 | |
934 | 937 | EXAMPLES: |
| 938 | sage: from sage.modular.congroup import is_Gamma1 |
935 | 939 | sage: is_Gamma1(SL2Z) |
936 | 940 | True |
937 | 941 | sage: is_Gamma1(Gamma1(13)) |
… |
… |
|
1178 | 1182 | Return True if x is a congruence subgroup of type GammaH. |
1179 | 1183 | |
1180 | 1184 | EXAMPLES: |
| 1185 | sage: from sage.modular.congroup import is_GammaH |
1181 | 1186 | sage: is_GammaH(GammaH(13, [2])) |
1182 | 1187 | True |
1183 | 1188 | sage: is_GammaH(Gamma0(6)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/dirichlet.py
a
|
b
|
|
1377 | 1377 | Returns True if x is a Dirichlet group. |
1378 | 1378 | |
1379 | 1379 | EXAMPLES: |
| 1380 | sage: from sage.modular.dirichlet import is_DirichletGroup |
1380 | 1381 | sage: is_DirichletGroup(DirichletGroup(11)) |
1381 | 1382 | True |
1382 | 1383 | sage: is_DirichletGroup(11) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/modform/element.py
a
|
b
|
|
22 | 22 | Return True if x is a modular form. |
23 | 23 | |
24 | 24 | EXAMPLES: |
| 25 | sage: from sage.modular.modform.element import is_ModularFormElement |
25 | 26 | sage: is_ModularFormElement(5) |
26 | 27 | False |
27 | 28 | sage: is_ModularFormElement(ModularForms(11).0) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/modular/modform/space.py
a
|
b
|
|
67 | 67 | Return True if x is a $\code{ModularFormsSpace}$. |
68 | 68 | |
69 | 69 | EXAMPLES: |
| 70 | sage: from sage.modular.modform.space import is_ModularFormsSpace |
70 | 71 | sage: is_ModularFormsSpace(ModularForms(11,2)) |
71 | 72 | True |
72 | 73 | sage: is_ModularFormsSpace(CuspForms(11,2)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/modules/free_module.py
a
|
b
|
|
427 | 427 | Return True if M inherits from from FreeModule_generic. |
428 | 428 | |
429 | 429 | EXAMPLES: |
| 430 | sage: from sage.modules.free_module import is_FreeModule |
430 | 431 | sage: V = ZZ^3 |
431 | 432 | sage: is_FreeModule(V) |
432 | 433 | True |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/modules/free_quadratic_module.py
a
|
b
|
|
243 | 243 | Returns True if M is a free quadratic module. |
244 | 244 | |
245 | 245 | EXAMPLES: |
| 246 | sage: from sage.modules.free_quadratic_module import is_FreeQuadraticModule |
246 | 247 | sage: U = FreeModule(QQ,3) |
247 | 248 | sage: is_FreeQuadraticModule(U) |
248 | 249 | False |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/modules/module.pyx
a
|
b
|
|
67 | 67 | Return True if x is a module. |
68 | 68 | |
69 | 69 | EXAMPLES: |
| 70 | sage: from sage.modules.module import is_Module |
70 | 71 | sage: M = FreeModule(RationalField(),30) |
71 | 72 | sage: is_Module(M) |
72 | 73 | True |
… |
… |
|
80 | 81 | Return True if x is a vector space. |
81 | 82 | |
82 | 83 | EXAMPLES: |
| 84 | sage: from sage.modules.module import is_Module, is_VectorSpace |
83 | 85 | sage: M = FreeModule(RationalField(),30) |
84 | 86 | sage: is_VectorSpace(M) |
85 | 87 | True |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/monoids/free_abelian_monoid.py
a
|
b
|
|
95 | 95 | Return True if $x$ is a free abelian monoid. |
96 | 96 | |
97 | 97 | EXAMPLES: |
| 98 | sage: from sage.monoids.free_abelian_monoid import is_FreeAbelianMonoid |
98 | 99 | sage: is_FreeAbelianMonoid(5) |
99 | 100 | False |
100 | 101 | sage: is_FreeAbelianMonoid(FreeAbelianMonoid(7,'a')) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/monoids/free_monoid.py
a
|
b
|
|
72 | 72 | Return True if $x$ is a free monoid. |
73 | 73 | |
74 | 74 | EXAMPLES: |
| 75 | sage: from sage.monoids.free_monoid import is_FreeMonoid |
75 | 76 | sage: is_FreeMonoid(5) |
76 | 77 | False |
77 | 78 | sage: is_FreeMonoid(FreeMonoid(7,'a')) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/plot/plot.py
a
|
b
|
|
288 | 288 | Return True if $x$ is a Graphics object. |
289 | 289 | |
290 | 290 | EXAMPLES: |
| 291 | sage: from sage.plot.plot import is_Graphics |
291 | 292 | sage: is_Graphics(1) |
292 | 293 | False |
293 | 294 | sage: is_Graphics(disk((0.0, 0.0), 1, (0, pi/2))) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/complex_double.pyx
a
|
b
|
|
492 | 492 | """ |
493 | 493 | Return True if x is a is_ComplexDoubleElement. |
494 | 494 | |
495 | | EXAMPLES: |
| 495 | EXAMPLES: |
| 496 | sage: from sage.rings.complex_double import is_ComplexDoubleElement |
496 | 497 | sage: is_ComplexDoubleElement(0) |
497 | 498 | False |
498 | 499 | sage: is_ComplexDoubleElement(CDF(0)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/complex_number.pyx
a
|
b
|
|
46 | 46 | \code{ComplexNumber} type. |
47 | 47 | |
48 | 48 | EXAMPLES: |
| 49 | sage: from sage.rings.complex_number import is_ComplexNumber |
49 | 50 | sage: a = ComplexNumber(1,2); a |
50 | 51 | 1.00000000000000 + 2.00000000000000*I |
51 | 52 | sage: is_ComplexNumber(a) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/finite_field.py
a
|
b
|
|
275 | 275 | Returns True if x is a prime finite field. |
276 | 276 | |
277 | 277 | EXAMPLES: |
| 278 | sage: from sage.rings.finite_field import is_PrimeFiniteField |
278 | 279 | sage: is_PrimeFiniteField(QQ) |
279 | 280 | False |
280 | 281 | sage: is_PrimeFiniteField(GF(7)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/finite_field_element.py
a
|
b
|
|
40 | 40 | Returns if x is a finite field element. |
41 | 41 | |
42 | 42 | EXAMPLE: |
| 43 | sage: from sage.rings.finite_field_element import is_FiniteFieldElement |
43 | 44 | sage: is_FiniteFieldElement(1) |
44 | | False |
| 45 | False |
45 | 46 | sage: is_FiniteFieldElement(IntegerRing()) |
46 | | False |
| 47 | False |
47 | 48 | sage: is_FiniteFieldElement(GF(5)(2)) |
48 | | True |
| 49 | True |
49 | 50 | |
50 | 51 | """ |
51 | 52 | return isinstance(x, element.Element) and ring.is_FiniteField(x.parent()) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/finite_field_ntl_gf2e.pyx
a
|
b
|
|
1100 | 1100 | sage: e.polynomial() |
1101 | 1101 | a^15 + a^13 + a^11 + a^10 + a^9 + a^8 + a^7 + a^6 + a^4 + a + 1 |
1102 | 1102 | |
| 1103 | sage: from sage.rings.polynomial.polynomial_element import is_Polynomial |
1103 | 1104 | sage: is_Polynomial(e.polynomial()) |
1104 | 1105 | True |
1105 | 1106 | |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/fraction_field.py
a
|
b
|
|
111 | 111 | """ |
112 | 112 | Tests whether or not x inherits from FractionField_generic. |
113 | 113 | |
114 | | EXAMPLES: |
| 114 | EXAMPLES: |
| 115 | sage: from sage.rings.fraction_field import is_FractionField |
115 | 116 | sage: is_FractionField(Frac(ZZ['x'])) |
116 | 117 | True |
117 | 118 | sage: is_FractionField(QQ) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/fraction_field_element.py
a
|
b
|
|
38 | 38 | """ |
39 | 39 | Returns whether or not x is of type FractionFieldElement |
40 | 40 | |
41 | | EXAMPLES: |
| 41 | EXAMPLES: |
| 42 | sage: from sage.rings.fraction_field_element import is_FractionFieldElement |
42 | 43 | sage: R.<x> = ZZ[] |
43 | 44 | sage: is_FractionFieldElement(x/2) |
44 | 45 | False |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/ideal.py
a
|
b
|
|
167 | 167 | A simple example involving the ring of integers. Note that SAGE does |
168 | 168 | not interpret rings objects themselves as ideals. However, one can |
169 | 169 | still explicitly construct these ideals: |
| 170 | sage: from sage.rings.ideal import is_Ideal |
170 | 171 | sage: R = ZZ |
171 | 172 | sage: is_Ideal(R) |
172 | 173 | False |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/integer.pyx
a
|
b
|
|
229 | 229 | Return true if x is of the SAGE integer type. |
230 | 230 | |
231 | 231 | EXAMPLES: |
| 232 | sage: from sage.rings.integer import is_Integer |
232 | 233 | sage: is_Integer(2) |
233 | 234 | True |
234 | 235 | sage: is_Integer(2/1) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/integer_mod.pyx
a
|
b
|
|
140 | 140 | Return \code{True} if and only if x is an integer modulo $n$. |
141 | 141 | |
142 | 142 | EXAMPLES: |
| 143 | sage: from sage.rings.integer_mod import is_IntegerMod |
143 | 144 | sage: is_IntegerMod(5) |
144 | 145 | False |
145 | 146 | sage: is_IntegerMod(Mod(5,10)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/integer_mod_ring.py
a
|
b
|
|
110 | 110 | Return True if x is an integer modulo ring. |
111 | 111 | |
112 | 112 | EXAMPLES: |
| 113 | sage: from sage.rings.integer_mod_ring import is_IntegerModRing |
113 | 114 | sage: R = IntegerModRing(17) |
114 | 115 | sage: is_IntegerModRing(R) |
115 | 116 | True |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field.py
a
|
b
|
|
456 | 456 | Number Field in a with defining polynomial x^2 - 9 |
457 | 457 | |
458 | 458 | Quadratic number fields derive from general number fields. |
| 459 | sage: from sage.rings.number_field.number_field import is_NumberField |
459 | 460 | sage: type(K) |
460 | 461 | <class 'sage.rings.number_field.number_field.NumberField_quadratic'> |
461 | 462 | sage: is_NumberField(K) |
… |
… |
|
474 | 475 | Return True if x is an absolute number field. |
475 | 476 | |
476 | 477 | EXAMPLES: |
| 478 | sage: from sage.rings.number_field.number_field import is_AbsoluteNumberField |
477 | 479 | sage: is_AbsoluteNumberField(NumberField(x^2+1,'a')) |
478 | 480 | True |
479 | 481 | sage: is_AbsoluteNumberField(NumberField([x^3 + 17, x^2+1],'a')) |
… |
… |
|
490 | 492 | Return True if x is of the quadratic \emph{number} field type. |
491 | 493 | |
492 | 494 | EXAMPLES: |
| 495 | sage: from sage.rings.number_field.number_field import is_QuadraticField |
493 | 496 | sage: is_QuadraticField(QuadraticField(5,'a')) |
494 | 497 | True |
495 | 498 | sage: is_QuadraticField(NumberField(x^2 - 5, 'b')) |
… |
… |
|
509 | 512 | Return True if x is a relative number field. |
510 | 513 | |
511 | 514 | EXAMPLES: |
| 515 | sage: from sage.rings.number_field.number_field import is_RelativeNumberField |
512 | 516 | sage: is_RelativeNumberField(NumberField(x^2+1,'a')) |
513 | 517 | False |
514 | 518 | sage: k.<a> = NumberField(x^3 - 2) |
… |
… |
|
608 | 612 | cyclotomic field. |
609 | 613 | |
610 | 614 | EXAMPLES: |
| 615 | sage: from sage.rings.number_field.number_field import is_CyclotomicField |
611 | 616 | sage: is_CyclotomicField(NumberField(x^2 + 1,'zeta4')) |
612 | 617 | False |
613 | 618 | sage: is_CyclotomicField(CyclotomicField(4)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field_base.pyx
a
|
b
|
|
12 | 12 | Return True if x is of number field type. |
13 | 13 | |
14 | 14 | EXAMPLES: |
| 15 | sage: from sage.rings.number_field.number_field_base import is_NumberField |
15 | 16 | sage: is_NumberField(NumberField(x^2+1,'a')) |
16 | 17 | True |
17 | 18 | sage: is_NumberField(QuadraticField(-97,'theta')) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field_element.pyx
a
|
b
|
|
69 | 69 | element of a number field. |
70 | 70 | |
71 | 71 | EXAMPLES: |
| 72 | sage: from sage.rings.number_field.number_field_element import is_NumberFieldElement |
72 | 73 | sage: is_NumberFieldElement(2) |
73 | 74 | False |
74 | 75 | sage: k.<a> = NumberField(x^7 + 17*x + 1) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field_ideal.py
a
|
b
|
|
773 | 773 | Return True if x is an ideal of a number field. |
774 | 774 | |
775 | 775 | EXAMPLES: |
| 776 | sage: from sage.rings.number_field.number_field_ideal import is_NumberFieldIdeal |
776 | 777 | sage: is_NumberFieldIdeal(2/3) |
777 | 778 | False |
778 | 779 | sage: is_NumberFieldIdeal(ideal(5)) |
… |
… |
|
1112 | 1113 | Return True if x is a fractional ideal of a number field. |
1113 | 1114 | |
1114 | 1115 | EXAMPLES: |
| 1116 | sage: from sage.rings.number_field.number_field_ideal import is_NumberFieldFractionalIdeal |
1115 | 1117 | sage: is_NumberFieldFractionalIdeal(2/3) |
1116 | 1118 | False |
1117 | 1119 | sage: is_NumberFieldFractionalIdeal(ideal(5)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/number_field_ideal_rel.py
a
|
b
|
|
172 | 172 | Return True if x is a fractional ideal of a relative number field. |
173 | 173 | |
174 | 174 | 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 |
175 | 177 | sage: is_NumberFieldFractionalIdeal_rel(2/3) |
176 | 178 | False |
177 | 179 | sage: is_NumberFieldFractionalIdeal_rel(ideal(5)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/number_field/order.py
a
|
b
|
|
47 | 47 | Return True if R an order in a number field or R is the ring ZZ of integers. |
48 | 48 | |
49 | 49 | EXAMPLES: |
| 50 | sage: from sage.rings.number_field.order import is_NumberFieldOrder |
50 | 51 | sage: is_NumberFieldOrder(NumberField(x^2+1,'a').maximal_order()) |
51 | 52 | True |
52 | 53 | sage: is_NumberFieldOrder(ZZ) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/laurent_polynomial_ring.py
a
|
b
|
|
34 | 34 | Returns True if and only if R is a Laurent polynomial ring. |
35 | 35 | |
36 | 36 | EXAMPLES: |
| 37 | sage: from sage.rings.polynomial.laurent_polynomial_ring import is_LaurentPolynomialRing |
37 | 38 | sage: P = PolynomialRing(QQ,2,'x') |
38 | 39 | sage: is_LaurentPolynomialRing(P) |
39 | 40 | False |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/multi_polynomial_ideal.py
a
|
b
|
|
264 | 264 | INPUT: |
265 | 265 | x -- an arbitrary object |
266 | 266 | |
267 | | EXAMPLE: |
| 267 | EXAMPLES: |
| 268 | sage: from sage.rings.polynomial.all import is_MPolynomialIdeal |
268 | 269 | sage: P.<x,y,z> = PolynomialRing(QQ) |
269 | 270 | sage: I = [x + 2*y + 2*z - 1, x^2 + 2*y^2 + 2*z^2 - x, 2*x*y + 2*y*z - y] |
270 | 271 | |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/polynomial_element.pyx
a
|
b
|
|
75 | 75 | f -- an object |
76 | 76 | |
77 | 77 | EXAMPLES: |
| 78 | sage: from sage.rings.polynomial.polynomial_element import is_Polynomial |
78 | 79 | sage: R.<x> = ZZ[] |
79 | 80 | sage: is_Polynomial(x^3 + x + 1) |
80 | 81 | True |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/polynomial/polynomial_ring.py
a
|
b
|
|
104 | 104 | polynomial ring in one variable). |
105 | 105 | |
106 | 106 | EXAMPLES: |
| 107 | sage: from sage.rings.polynomial.polynomial_ring import is_PolynomialRing |
| 108 | sage: from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing |
107 | 109 | sage: is_PolynomialRing(2) |
108 | 110 | False |
109 | 111 | |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/power_series_ring.py
a
|
b
|
|
178 | 178 | Return True if R is a power series ring. |
179 | 179 | |
180 | 180 | EXAMPLES: |
| 181 | sage: from sage.rings.power_series_ring import is_PowerSeriesRing |
181 | 182 | sage: is_PowerSeriesRing(10) |
182 | 183 | False |
183 | 184 | sage: is_PowerSeriesRing(QQ[['x']]) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/real_mpfr.pyx
a
|
b
|
|
3812 | 3812 | element of the MPFR real field with some precision. |
3813 | 3813 | |
3814 | 3814 | EXAMPLES: |
| 3815 | sage: from sage.rings.real_mpfr import is_RealNumber |
3815 | 3816 | sage: is_RealNumber(2.5) |
3816 | 3817 | True |
3817 | 3818 | sage: is_RealNumber(float(2.3)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/rings/ring.pyx
a
|
b
|
|
1248 | 1248 | Return True if x is a field. |
1249 | 1249 | |
1250 | 1250 | EXAMPLES: |
| 1251 | sage: from sage.rings.ring import is_Field |
1251 | 1252 | sage: is_Field(QQ) |
1252 | 1253 | True |
1253 | 1254 | sage: is_Field(ZZ) |
… |
… |
|
2009 | 2010 | Return True if x is of type finite field, and False otherwise. |
2010 | 2011 | |
2011 | 2012 | EXAMPLES: |
| 2013 | sage: from sage.rings.ring import is_FiniteField |
2012 | 2014 | sage: is_FiniteField(GF(9,'a')) |
2013 | 2015 | True |
2014 | 2016 | sage: is_FiniteField(GF(next_prime(10^10))) |
… |
… |
|
2080 | 2082 | Return true if x is a ring. |
2081 | 2083 | |
2082 | 2084 | EXAMPLES: |
| 2085 | sage: from sage.rings.ring import is_Ring |
2083 | 2086 | sage: is_Ring(ZZ) |
2084 | 2087 | True |
2085 | 2088 | """ |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/elliptic_curves/ell_generic.py
a
|
b
|
|
85 | 85 | def is_EllipticCurve(x): |
86 | 86 | """ |
87 | 87 | EXAMPLES: |
| 88 | sage: from sage.schemes.elliptic_curves.ell_generic import is_EllipticCurve |
88 | 89 | sage: E = EllipticCurve([1,2,3/4,7,19]) |
89 | 90 | sage: is_EllipticCurve(E) |
90 | 91 | True |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/affine_space.py
a
|
b
|
|
41 | 41 | $\A^n_R$, where $R$ is a ring and $n\geq 0$ is an integer. |
42 | 42 | |
43 | 43 | EXAMPLES: |
| 44 | sage: from sage.schemes.generic.affine_space import is_AffineSpace |
44 | 45 | sage: is_AffineSpace(AffineSpace(5, names='x')) |
45 | 46 | True |
46 | 47 | sage: is_AffineSpace(AffineSpace(5, GF(9,'alpha'), names='x')) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/algebraic_scheme.py
a
|
b
|
|
43 | 43 | EXAMPLES: |
44 | 44 | Affine space is itself not an algebraic scheme, though the closed subscheme |
45 | 45 | defined by no equations is. |
| 46 | sage: from sage.schemes.generic.algebraic_scheme import is_AlgebraicScheme |
46 | 47 | sage: is_AlgebraicScheme(AffineSpace(10, QQ)) |
47 | 48 | False |
48 | 49 | sage: V = AffineSpace(10, QQ).subscheme([]); V |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/scheme.py
a
|
b
|
|
38 | 38 | Return True if $x$ is a scheme. |
39 | 39 | |
40 | 40 | EXAMPLES: |
| 41 | sage: from sage.schemes.generic.scheme import is_Scheme |
41 | 42 | sage: is_Scheme(5) |
42 | 43 | False |
43 | 44 | sage: X = Spec(QQ) |
… |
… |
|
501 | 502 | Return True if $x$ is an affine scheme. |
502 | 503 | |
503 | 504 | EXAMPLES: |
| 505 | sage: from sage.schemes.generic.scheme import is_AffineScheme |
504 | 506 | sage: is_AffineScheme(5) |
505 | 507 | False |
506 | 508 | sage: E = Spec(QQ) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/schemes/generic/spec.py
a
|
b
|
|
15 | 15 | def is_Spec(X): |
16 | 16 | """ |
17 | 17 | EXAMPLES: |
| 18 | sage: from sage.schemes.generic.spec import is_Spec |
18 | 19 | sage: is_Spec(QQ^3) |
19 | 20 | False |
20 | 21 | sage: X = Spec(QQ); X |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/sets/set.py
a
|
b
|
|
108 | 108 | |
109 | 109 | def is_Set(x): |
110 | 110 | """ |
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 |
112 | 112 | a Python 2.4 set). |
113 | 113 | |
114 | 114 | EXAMPLES: |
| 115 | sage: from sage.sets.set import is_Set |
115 | 116 | sage: is_Set([1,2,3]) |
116 | 117 | False |
117 | 118 | sage: is_Set(set([1,2,3])) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/element.pyx
a
|
b
|
|
247 | 247 | Return True if x is of type Element. |
248 | 248 | |
249 | 249 | EXAMPLES: |
| 250 | sage: from sage.structure.element import is_Element |
250 | 251 | sage: is_Element(2/3) |
251 | 252 | True |
252 | 253 | sage: is_Element(QQ^3) |
… |
… |
|
637 | 638 | This is even faster than using isinstance inline. |
638 | 639 | |
639 | 640 | EXAMPLES: |
| 641 | sage: from sage.structure.element import is_ModuleElement |
640 | 642 | sage: is_ModuleElement(2/3) |
641 | 643 | True |
642 | 644 | sage: is_ModuleElement((QQ^3).0) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent.pyx
a
|
b
|
|
96 | 96 | sage.structure.parent.Parent and False otherwise. |
97 | 97 | |
98 | 98 | EXAMPLES: |
| 99 | sage: from sage.structure.parent import is_Parent |
99 | 100 | sage: is_Parent(2/3) |
100 | 101 | False |
101 | 102 | sage: is_Parent(ZZ) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent_gens.pyx
a
|
b
|
|
73 | 73 | from sage.structure.parent.ParentWithGens and False otherwise. |
74 | 74 | |
75 | 75 | EXAMPLES: |
| 76 | sage: from sage.structure.parent_gens import is_ParentWithGens |
76 | 77 | sage: is_ParentWithGens(QQ['x']) |
77 | 78 | True |
78 | 79 | sage: is_ParentWithGens(CC) |
… |
… |
|
90 | 91 | otherwise. |
91 | 92 | |
92 | 93 | EXAMPLES: |
| 94 | sage: from sage.structure.parent_gens import is_ParentWithAdditiveAbelianGens |
93 | 95 | sage: is_ParentWithAdditiveAbelianGens(QQ) |
94 | 96 | False |
95 | 97 | sage: is_ParentWithAdditiveAbelianGens(QQ^3) |
… |
… |
|
105 | 107 | otherwise. |
106 | 108 | |
107 | 109 | EXAMPLES: |
| 110 | sage: from sage.structure.parent_gens import is_ParentWithMultiplicativeAbelianGens |
108 | 111 | sage: is_ParentWithMultiplicativeAbelianGens(QQ) |
109 | 112 | False |
110 | 113 | sage: is_ParentWithMultiplicativeAbelianGens(DirichletGroup(11)) |
-
diff -r 458d97c4b17c -r 727cf7cbc350 sage/structure/parent_old.pyx
a
|
b
|
|
30 | 30 | include '../ext/python_object.pxi' |
31 | 31 | include '../ext/python_bool.pxi' |
32 | 32 | include '../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)) |
48 | 33 | |
49 | 34 | cdef inline check_old_coerce(Parent p): |
50 | 35 | if p._element_constructor is not None: |