diff --git a/src/sage/algebras/free_algebra_quotient.py b/src/sage/algebras/free_algebra_quotient.py index 583eb5f9ae8..4d5000b3df4 100644 --- a/src/sage/algebras/free_algebra_quotient.py +++ b/src/sage/algebras/free_algebra_quotient.py @@ -295,6 +295,8 @@ def module(self): """ The free module of the algebra. + EXAMPLES:: + sage: H = sage.algebras.free_algebra_quotient.hamilton_quatalg(QQ)[0]; H Free algebra quotient on 3 generators ('i', 'j', 'k') and dimension 4 over Rational Field sage: H.module() diff --git a/src/sage/algebras/iwahori_hecke_algebra.py b/src/sage/algebras/iwahori_hecke_algebra.py index 900039c7909..6df42729b70 100644 --- a/src/sage/algebras/iwahori_hecke_algebra.py +++ b/src/sage/algebras/iwahori_hecke_algebra.py @@ -2491,6 +2491,8 @@ def __init__(self, IHAlgebra, prefix=None): r""" Initialize the `A`-basis of the Iwahori-Hecke algebra ``IHAlgebra``. + EXAMPLES:: + sage: R. = LaurentPolynomialRing(QQ) sage: H = IwahoriHeckeAlgebra('A3', v**2) sage: A = H.A() diff --git a/src/sage/algebras/quatalg/quaternion_algebra.py b/src/sage/algebras/quatalg/quaternion_algebra.py index 4b7af26d31c..58bc0da3d24 100644 --- a/src/sage/algebras/quatalg/quaternion_algebra.py +++ b/src/sage/algebras/quatalg/quaternion_algebra.py @@ -1337,8 +1337,8 @@ def __init__(self, A, basis, check=True): sage: type(R) - Over QQ and number fields it is checked whether the given - basis actually gives an order (as a module over the maximal order): + Over QQ and number fields it is checked whether the given + basis actually gives an order (as a module over the maximal order):: sage: A. = QuaternionAlgebra(-1,-1) sage: A.quaternion_order([1,i,j,i-j]) diff --git a/src/sage/categories/cartesian_product.py b/src/sage/categories/cartesian_product.py index e6fbf670750..f61cca89629 100644 --- a/src/sage/categories/cartesian_product.py +++ b/src/sage/categories/cartesian_product.py @@ -155,7 +155,7 @@ def __call__(self, args, **kwds): sage: _.category() Category of Cartesian products of finite enumerated sets - Check that the empty product is handled correctly: + Check that the empty product is handled correctly:: sage: C = cartesian_product([]) sage: C diff --git a/src/sage/categories/domains.py b/src/sage/categories/domains.py index 2cdbb4cd2ce..c40f95ba880 100644 --- a/src/sage/categories/domains.py +++ b/src/sage/categories/domains.py @@ -57,18 +57,18 @@ def _test_zero_divisors(self, **options): In rings whose elements can not be represented exactly, there may be zero divisors in practice, even though these rings do not have them in theory. For such inexact rings, these tests - are not performed: - - sage: R = ZpFM(5); R - 5-adic Ring of fixed modulus 5^20 - sage: R.is_exact() - False - sage: a = R(5^19) - sage: a.is_zero() - False - sage: (a*a).is_zero() - True - sage: R._test_zero_divisors() + are not performed:: + + sage: R = ZpFM(5); R + 5-adic Ring of fixed modulus 5^20 + sage: R.is_exact() + False + sage: a = R(5^19) + sage: a.is_zero() + False + sage: (a*a).is_zero() + True + sage: R._test_zero_divisors() EXAMPLES:: diff --git a/src/sage/categories/examples/sets_cat.py b/src/sage/categories/examples/sets_cat.py index c4df13b1357..a69af2a6118 100644 --- a/src/sage/categories/examples/sets_cat.py +++ b/src/sage/categories/examples/sets_cat.py @@ -160,7 +160,7 @@ class PrimeNumbers_Abstract(UniqueRepresentation, Parent): datastructure will then be constructed by inheriting from :class:`PrimeNumbers_Abstract`. - This is used by: + This is used by:: sage: P = Sets().example("facade") sage: P = Sets().example("inherits") diff --git a/src/sage/categories/magmas.py b/src/sage/categories/magmas.py index ff1a7f955c5..33dc2bb973a 100644 --- a/src/sage/categories/magmas.py +++ b/src/sage/categories/magmas.py @@ -711,6 +711,8 @@ def one(self): r""" Return the unit element of ``self``. + EXAMPLES:: + sage: from sage.combinat.root_system.extended_affine_weyl_group import ExtendedAffineWeylGroup sage: PvW0 = ExtendedAffineWeylGroup(['A',2,1]).PvW0() sage: PvW0 in Magmas().Unital().Realizations() diff --git a/src/sage/coding/abstract_code.py b/src/sage/coding/abstract_code.py index 238a165c021..c041e8d0eb2 100644 --- a/src/sage/coding/abstract_code.py +++ b/src/sage/coding/abstract_code.py @@ -337,7 +337,7 @@ def __iter__(self): ....: super().__init__(10) We check we get a sensible error message while asking for an - iterator over the elements of our new class: + iterator over the elements of our new class:: sage: C = MyCode() sage: list(C) @@ -365,7 +365,7 @@ def __contains__(self, c): ....: super().__init__(length) We check we get a sensible error message while asking if an element is - in our new class: + in our new class:: sage: C = MyCode(3) sage: vector((1, 0, 0, 0, 0, 1, 1)) in C @@ -461,7 +461,7 @@ def _repr_(self): ....: super().__init__(10) We check we get a sensible error message while asking for a string - representation of an instance of our new class: + representation of an instance of our new class:: sage: C = MyCode() sage: C #random @@ -489,7 +489,7 @@ def _latex_(self): ....: super().__init__(10) We check we get a sensible error message while asking for a string - representation of an instance of our new class: + representation of an instance of our new class:: sage: C = MyCode() sage: latex(C) diff --git a/src/sage/coding/guruswami_sudan/interpolation.py b/src/sage/coding/guruswami_sudan/interpolation.py index e1f9755faa3..af150b460c6 100644 --- a/src/sage/coding/guruswami_sudan/interpolation.py +++ b/src/sage/coding/guruswami_sudan/interpolation.py @@ -184,7 +184,7 @@ def _interpolation_matrix_problem(points, tau, parameters, wy): EXAMPLES: The following parameters arise from Guruswami-Sudan decoding of an [6,2,5] - GRS code over F(11) with multiplicity 2 and list size 4. + GRS code over F(11) with multiplicity 2 and list size 4. :: sage: from sage.coding.guruswami_sudan.interpolation import _interpolation_matrix_problem sage: F = GF(11) diff --git a/src/sage/coding/linear_code_no_metric.py b/src/sage/coding/linear_code_no_metric.py index 9610c4e31ce..932ad7ad937 100644 --- a/src/sage/coding/linear_code_no_metric.py +++ b/src/sage/coding/linear_code_no_metric.py @@ -538,7 +538,7 @@ def systematic_generator_matrix(self, systematic_positions=None): [1 2 0 1] [0 0 1 2] - Specific systematic positions can also be requested: + Specific systematic positions can also be requested:: sage: C.systematic_generator_matrix(systematic_positions=[3,2]) [1 2 0 1] diff --git a/src/sage/combinat/colored_permutations.py b/src/sage/combinat/colored_permutations.py index 28b20e502af..c7f134efbe0 100644 --- a/src/sage/combinat/colored_permutations.py +++ b/src/sage/combinat/colored_permutations.py @@ -87,6 +87,8 @@ def __len__(self): """ Return the length of the one line form of ``self``. + EXAMPLES:: + sage: C = ColoredPermutations(2, 3) sage: s1,s2,t = C.gens() sage: len(s1) diff --git a/src/sage/combinat/ordered_tree.py b/src/sage/combinat/ordered_tree.py index fce1668bd22..702b83cb051 100644 --- a/src/sage/combinat/ordered_tree.py +++ b/src/sage/combinat/ordered_tree.py @@ -224,7 +224,7 @@ def _auto_parent(cls): .. NOTE:: - It is possible to bypass the automatic parent mechanism using: + It is possible to bypass the automatic parent mechanism using:: sage: t1 = OrderedTree.__new__(OrderedTree, Parent(), []) sage: t1.__init__(Parent(), []) diff --git a/src/sage/combinat/permutation.py b/src/sage/combinat/permutation.py index ec1958ee313..cd8d882a9d2 100644 --- a/src/sage/combinat/permutation.py +++ b/src/sage/combinat/permutation.py @@ -4271,7 +4271,7 @@ def permutohedron_join(self, other, side="right") -> Permutation: sage: p.permutohedron_join(p) [1] - The left permutohedron: + The left permutohedron:: sage: p = Permutation([3,1,2]) sage: q = Permutation([1,3,2]) @@ -4387,7 +4387,7 @@ def permutohedron_meet(self, other, side="right") -> Permutation: sage: p.permutohedron_meet(p) [1] - The left permutohedron: + The left permutohedron:: sage: p = Permutation([3,1,2]) sage: q = Permutation([1,3,2]) diff --git a/src/sage/combinat/posets/hasse_diagram.py b/src/sage/combinat/posets/hasse_diagram.py index f59f4fd951f..93990ee7cbc 100644 --- a/src/sage/combinat/posets/hasse_diagram.py +++ b/src/sage/combinat/posets/hasse_diagram.py @@ -1994,7 +1994,7 @@ def orthocomplementations_iterator(self): [] Unique orthocomplementations; second is not uniquely complemented, - but has only one orthocomplementation. + but has only one orthocomplementation:: sage: H = posets.BooleanLattice(4)._hasse_diagram # Uniquely complemented sage: len(list(H.orthocomplementations_iterator())) diff --git a/src/sage/combinat/root_system/type_affine.py b/src/sage/combinat/root_system/type_affine.py index 12bf38eb52a..5ce62dfb7be 100644 --- a/src/sage/combinat/root_system/type_affine.py +++ b/src/sage/combinat/root_system/type_affine.py @@ -51,7 +51,7 @@ class AmbientSpace(CombinatorialFreeModule): \delta,\delta\rangle=0` and similarly for the null coroot. In the current implementation, `\Lambda_0` and the null coroot - are identified: + are identified:: sage: L = RootSystem(["A",3,1]).ambient_space() sage: Lambda = L.fundamental_weights() diff --git a/src/sage/combinat/sf/dual.py b/src/sage/combinat/sf/dual.py index 837dc57e0b7..90ed7f7ac8c 100644 --- a/src/sage/combinat/sf/dual.py +++ b/src/sage/combinat/sf/dual.py @@ -214,7 +214,7 @@ def _self_to_dual(self, x): sage: h._self_to_dual(h([2,1]) + 3*h[1,1,1]) 21*m[1, 1, 1] + 11*m[2, 1] + 4*m[3] - This is for internal use only. Please use instead: + This is for internal use only. Please use instead:: sage: m(h([2,1]) + 3*h[1,1,1]) 21*m[1, 1, 1] + 11*m[2, 1] + 4*m[3] diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index b435764a746..19b67895169 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -501,7 +501,7 @@ def _repr_(self): sage: Sym.macdonald(q=1,t=3).P() Sym in the Macdonald P with q=1 and t=3 basis - Hall-Littlewood polynomials: + Hall-Littlewood polynomials:: sage: Sym.hall_littlewood().P() Sym in the Hall-Littlewood P basis diff --git a/src/sage/combinat/subset.py b/src/sage/combinat/subset.py index 5cae6958510..9505b1d4ced 100644 --- a/src/sage/combinat/subset.py +++ b/src/sage/combinat/subset.py @@ -342,9 +342,9 @@ def cardinality(self): sage: Subsets(3).cardinality() 8 - TESTS:: + TESTS: - ``__len__`` should return a Python int. + ``__len__`` should return a Python int:: sage: S = Subsets(Set([1,2,3])) sage: len(S) diff --git a/src/sage/combinat/tableau.py b/src/sage/combinat/tableau.py index 1105a3ea177..ae5e93682cc 100644 --- a/src/sage/combinat/tableau.py +++ b/src/sage/combinat/tableau.py @@ -233,7 +233,7 @@ def __init__(self, parent, t, check=True): A tableau is shallowly immutable. See :trac:`15862`. The entries themselves may be mutable objects, though in that case the - resulting Tableau should be unhashable. + resulting Tableau should be unhashable. :: sage: T = Tableau([[1,2],[2]]) sage: t0 = T[0] diff --git a/src/sage/combinat/words/paths.py b/src/sage/combinat/words/paths.py index 3d0ee41a4c4..b579aeae1ae 100644 --- a/src/sage/combinat/words/paths.py +++ b/src/sage/combinat/words/paths.py @@ -384,7 +384,7 @@ def __init__(self, alphabet, steps): True If size of alphabet is twice the number of steps, then opposite - vectors are used for the second part of the alphabet. + vectors are used for the second part of the alphabet:: sage: WordPaths('abcd',[(2,1),(2,4)]) Word Paths over 4 steps diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py index 56f96f2ef53..faa6a73cc7e 100644 --- a/src/sage/functions/special.py +++ b/src/sage/functions/special.py @@ -538,7 +538,7 @@ def _eval_(self, z, m): sage: elliptic_e(z, 1) elliptic_e(z, 1) - Here arccoth doesn't have 1 in its domain, so we just hold the expression: + Here arccoth doesn't have 1 in its domain, so we just hold the expression:: sage: elliptic_e(arccoth(1), x^2*e) elliptic_e(+Infinity, x^2*e) diff --git a/src/sage/game_theory/normal_form_game.py b/src/sage/game_theory/normal_form_game.py index a669cb153af..5068c8e10e3 100644 --- a/src/sage/game_theory/normal_form_game.py +++ b/src/sage/game_theory/normal_form_game.py @@ -2743,8 +2743,8 @@ def _is_degenerate_pure(self, certificate=False): sage: g._is_degenerate_pure() True - Whilst this game is not degenerate in pure strategies, it is - actually degenerate, but only in mixed strategies. + Whilst this game is not degenerate in pure strategies, it is + actually degenerate, but only in mixed strategies:: sage: A = matrix([[3, 0], [0, 3], [1.5, 1.5]]) sage: B = matrix([[4, 3], [2, 6], [3, 1]]) diff --git a/src/sage/geometry/cone.py b/src/sage/geometry/cone.py index 865fa9299f2..1967d71cc2d 100644 --- a/src/sage/geometry/cone.py +++ b/src/sage/geometry/cone.py @@ -6370,7 +6370,7 @@ def random_cone(lattice=None, min_ambient_dim=0, max_ambient_dim=None, TESTS: It's hard to test the output of a random process, but we can at - least make sure that we get a cone back. + least make sure that we get a cone back:: sage: from sage.geometry.cone import is_Cone sage: K = random_cone(max_ambient_dim=6, max_rays=10) diff --git a/src/sage/geometry/fan.py b/src/sage/geometry/fan.py index 26d814fb437..cd8041262a4 100644 --- a/src/sage/geometry/fan.py +++ b/src/sage/geometry/fan.py @@ -1390,7 +1390,7 @@ def _compute_cone_lattice(self): We use different algorithms depending on available information. One of the common cases is a fan which is KNOWN to be complete, i.e. we do - not even need to check if it is complete. + not even need to check if it is complete:: sage: fan = toric_varieties.P1xP1().fan() # optional - palp sage: fan.cone_lattice() # indirect doctest # optional - palp diff --git a/src/sage/geometry/lattice_polytope.py b/src/sage/geometry/lattice_polytope.py index 3a043815a38..8829815c84f 100644 --- a/src/sage/geometry/lattice_polytope.py +++ b/src/sage/geometry/lattice_polytope.py @@ -3783,7 +3783,7 @@ def points(self, *args, **kwds): M( 0, 0, 0) in 3-d lattice M - Only two of the above points: + Only two of the above points:: sage: p.points(1, 3) # optional - palp M(0, 1, 0), diff --git a/src/sage/geometry/newton_polygon.py b/src/sage/geometry/newton_polygon.py index 4f253741ab7..42f0edb9a4c 100644 --- a/src/sage/geometry/newton_polygon.py +++ b/src/sage/geometry/newton_polygon.py @@ -630,13 +630,15 @@ def __init__(self): """ Parent class for all Newton polygons. + EXAMPLES:: + sage: from sage.geometry.newton_polygon import ParentNewtonPolygon sage: ParentNewtonPolygon() Parent for Newton polygons TESTS: - This class is a singleton. + This class is a singleton:: sage: ParentNewtonPolygon() is ParentNewtonPolygon() True diff --git a/src/sage/geometry/polyhedron/base3.py b/src/sage/geometry/polyhedron/base3.py index 55bd007f234..21c06961421 100644 --- a/src/sage/geometry/polyhedron/base3.py +++ b/src/sage/geometry/polyhedron/base3.py @@ -604,7 +604,7 @@ def face_generator(self, face_dimension=None, algorithm=None, **kwds): A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices, A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices] - Check that we catch incorrect algorithms: + Check that we catch incorrect algorithms:: sage: list(P.face_generator(2, algorithm='integrate'))[:4] Traceback (most recent call last): diff --git a/src/sage/geometry/polyhedron/base_QQ.py b/src/sage/geometry/polyhedron/base_QQ.py index 0efcb15f1a2..c94b087a11d 100644 --- a/src/sage/geometry/polyhedron/base_QQ.py +++ b/src/sage/geometry/polyhedron/base_QQ.py @@ -119,7 +119,7 @@ def integral_points_count(self, verbose=False, use_Hrepresentation=False, 27 We enlarge the polyhedron to force the use of the generating function methods - implemented in LattE integrale, rather than explicit enumeration. + implemented in LattE integrale, rather than explicit enumeration:: sage: (1000000000*P).integral_points_count(verbose=True) # optional - latte_int This is LattE integrale... diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index 38e1f8d5751..48752f39020 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -5605,7 +5605,7 @@ def layout_planar(self, set_embedding=False, on_embedding=None, sage: g.layout(layout='planar', external_face=(3,1)) {0: [2, 1], 1: [0, 2], 2: [1, 1], 3: [1, 0]} - Choose the embedding: + Choose the embedding:: sage: H = graphs.LadderGraph(4) sage: em = {0:[1,4], 4:[0,5], 1:[5,2,0], 5:[4,6,1], 2:[1,3,6], 6:[7,5,2], 3:[7,2], 7:[3,6]} @@ -6356,7 +6356,7 @@ def num_faces(self, embedding=None): ... ValueError: no embedding is provided and the graph is not planar - Issue :trac:`22003` is fixed: + Issue :trac:`22003` is fixed:: sage: Graph(1).num_faces() 1 @@ -20622,7 +20622,7 @@ def plot(self, **options): 9: (0.47..., 0.15...)} sage: P = G.plot(save_pos=True, layout='spring') - The following illustrates the format of a position dictionary. + The following illustrates the format of a position dictionary:: sage: G.get_pos() # currently random across platforms, see #9593 {0: [1.17..., -0.855...], diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py index a7372d3d77e..be5e3372d6f 100644 --- a/src/sage/groups/perm_gps/permgroup.py +++ b/src/sage/groups/perm_gps/permgroup.py @@ -654,7 +654,7 @@ def gap(self): TESTS: - see that this method does not harm pickling: + see that this method does not harm pickling:: sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]) sage: A4.gap() @@ -662,7 +662,7 @@ def gap(self): sage: TestSuite(A4).run() the following test shows, that support for the ``self._libgap`` - attribute is needed in the constructor of the class: + attribute is needed in the constructor of the class:: sage: PG = PGU(6,2) sage: g, h = PG.gens() diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py index 0381e1912a1..4fb4a094244 100644 --- a/src/sage/groups/perm_gps/permgroup_named.py +++ b/src/sage/groups/perm_gps/permgroup_named.py @@ -635,7 +635,7 @@ def algebra(self, base_ring, category=None): Category of finite dimensional unital cellular semigroup algebras over Rational Field - In the following case, a usual group algebra is returned: + In the following case, a usual group algebra is returned:: sage: S = SymmetricGroup([2,3,5]) sage: S.algebra(QQ) diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py index 0f322f76e91..e992bea8e3a 100644 --- a/src/sage/interfaces/expect.py +++ b/src/sage/interfaces/expect.py @@ -1181,15 +1181,13 @@ def _expect_expr(self, expr=None, timeout=None): sage: singular._sendstr('def abc = 10 + 15;\n') Then we tell singular to print 10, which is an arbitrary number - different from the expected result 35. + different from the expected result 35:: sage: singular._sendstr('10;\n') Here an exception is raised because 25 hasn't appeared yet in the output stream. The key thing is that this doesn't lock, but instead - quickly raises an exception. - - :: + quickly raises an exception:: sage: t = walltime() sage: try: @@ -1203,21 +1201,15 @@ def _expect_expr(self, expr=None, timeout=None): sage: w = walltime(t); 0.3 < w < 10 True - We tell Singular to print abc, which equals 25. - - :: + We tell Singular to print abc, which equals 25:: sage: singular._sendstr('abc;\n') - Now 25 is in the output stream, so we can wait for it. - - :: + Now 25 is in the output stream, so we can wait for it:: sage: singular._expect_expr('25') - This gives us everything before the 25, including the 10 we printed earlier. - - :: + This gives us everything before the 25, including the 10 we printed earlier:: sage: singular._expect.before.decode('ascii') '...10\r\n> ' diff --git a/src/sage/interfaces/frobby.py b/src/sage/interfaces/frobby.py index 9f514422528..21668a48d31 100644 --- a/src/sage/interfaces/frobby.py +++ b/src/sage/interfaces/frobby.py @@ -123,7 +123,7 @@ def alexander_dual(self, monomial_ideal): True We see how it is much faster to compute this with frobby than the built-in - procedure for simplicial complexes. + procedure for simplicial complexes:: sage: t=simplicial_complexes.PoincareHomologyThreeSphere() # optional - frobby sage: R=PolynomialRing(QQ,16,'x') # optional - frobby diff --git a/src/sage/interfaces/interface.py b/src/sage/interfaces/interface.py index ae1b656b77f..bf6142f1150 100644 --- a/src/sage/interfaces/interface.py +++ b/src/sage/interfaces/interface.py @@ -880,7 +880,7 @@ def _reduce(self): `"'abc'"` instead. That is dependant on the Elements `is_string` function to be implemented correctly. This has gone wrong in the past and remained uncaught by the doctests because the original identifier was reused. This test makes sure - that does not happen again: + that does not happen again:: sage: a = r("'abc'") # optional - rpy2 sage: b = dumps(a) # optional - rpy2 diff --git a/src/sage/interfaces/quit.py b/src/sage/interfaces/quit.py index 3bbd3ae24d3..e068c324b13 100644 --- a/src/sage/interfaces/quit.py +++ b/src/sage/interfaces/quit.py @@ -149,7 +149,7 @@ def invalidate_all(): sage: b (invalid PARI/GP interpreter object -- The pari session in which this object was defined is no longer running.) - However the maxima and gp sessions should still work out, though with their state reset: + However the maxima and gp sessions should still work out, though with their state reset:: sage: a = maxima(2); b = gp(3) sage: a, b diff --git a/src/sage/interfaces/r.py b/src/sage/interfaces/r.py index e195936bc2d..92a67285d9c 100644 --- a/src/sage/interfaces/r.py +++ b/src/sage/interfaces/r.py @@ -512,7 +512,7 @@ def _lazy_init(self): sage: my_r._initialized # optional - rpy2 True - And on package import: + And on package import:: sage: my_r = R() # optional - rpy2 sage: my_r._initialized # optional - rpy2 @@ -521,7 +521,7 @@ def _lazy_init(self): sage: my_r._initialized # optional - rpy2 True - And when fetching help pages: + And when fetching help pages:: sage: my_r = R() # optional - rpy2 sage: my_r._initialized # optional - rpy2 diff --git a/src/sage/interfaces/tides.py b/src/sage/interfaces/tides.py index 3e8541a14ad..47e2c0c6561 100644 --- a/src/sage/interfaces/tides.py +++ b/src/sage/interfaces/tides.py @@ -356,6 +356,8 @@ def remove_constants(l1,l2): Given two lists, remove the entries in the first that are real constants, and also the corresponding elements in the second one. + EXAMPLES:: + sage: from sage.interfaces.tides import subexpressions_list, remove_constants sage: f(a)=[1+cos(7)*a] sage: l1, l2 = subexpressions_list(f) diff --git a/src/sage/manifolds/utilities.py b/src/sage/manifolds/utilities.py index de83d63326f..e082e2584af 100644 --- a/src/sage/manifolds/utilities.py +++ b/src/sage/manifolds/utilities.py @@ -1040,7 +1040,7 @@ def _latex_(self): sage: latex(ExpressionNice(fun)) \frac{\partial\,f_{x}}{\partial y} - If latex_name, it should be used in LaTeX output: + If latex_name, it should be used in LaTeX output:: sage: f = function('f_x', latex_name=r"{\cal F}")(x,y) sage: fun = f.diff(y) diff --git a/src/sage/matroids/constructor.py b/src/sage/matroids/constructor.py index 1fb2cd2b93e..dc5610f1536 100644 --- a/src/sage/matroids/constructor.py +++ b/src/sage/matroids/constructor.py @@ -360,7 +360,7 @@ def Matroid(groundset=None, data=None, **kwds): [0, 1, 2, 3] The GraphicMatroid object forces its graph to be connected. If a - disconnected graph is used as input, it will connect the components. + disconnected graph is used as input, it will connect the components:: sage: G1 = graphs.CycleGraph(3); G2 = graphs.DiamondGraph() sage: G = G1.disjoint_union(G2) diff --git a/src/sage/misc/bindable_class.py b/src/sage/misc/bindable_class.py index 92f57ef48cb..d995ad65fc8 100644 --- a/src/sage/misc/bindable_class.py +++ b/src/sage/misc/bindable_class.py @@ -160,7 +160,7 @@ class BoundClass(functools.partial): sage: c = x.Inner; c > - Introspection works, at least partially: + Introspection works, at least partially:: sage: sage_getdoc(c).strip() 'Some documentation for Outer.Inner' diff --git a/src/sage/misc/decorators.py b/src/sage/misc/decorators.py index ebfa844586b..ef22aebb242 100644 --- a/src/sage/misc/decorators.py +++ b/src/sage/misc/decorators.py @@ -389,7 +389,7 @@ def __call__(self, func): [('arrow_options', {'size': 5})] Demonstrate that the introspected argument specification of the - wrapped function is updated (see :trac:`9976`). + wrapped function is updated (see :trac:`9976`):: sage: from sage.misc.sageinspect import sage_getargspec sage: sage_getargspec(f) diff --git a/src/sage/misc/functional.py b/src/sage/misc/functional.py index 9419c145ad8..6e0e2abde37 100644 --- a/src/sage/misc/functional.py +++ b/src/sage/misc/functional.py @@ -1935,7 +1935,7 @@ def sqrt(x, *args, **kwds): sage: sqrt(2).n(prec=100) 1.4142135623730950488016887242 - Or one can input a numerical type. + Or one can input a numerical type:: sage: sqrt(2.) 1.41421356237310 diff --git a/src/sage/misc/misc.py b/src/sage/misc/misc.py index 6bebd478e60..f263f53bad3 100644 --- a/src/sage/misc/misc.py +++ b/src/sage/misc/misc.py @@ -1413,7 +1413,7 @@ def inject_variable(name, value, warn=True): sage: a 272 - That's because warn seem to not reissue twice the same warning: + That's because warn seem to not reissue twice the same warning:: sage: from warnings import warn sage: warn("blah") diff --git a/src/sage/modular/modform_hecketriangle/abstract_space.py b/src/sage/modular/modform_hecketriangle/abstract_space.py index efd12339000..c14a59f54d6 100644 --- a/src/sage/modular/modform_hecketriangle/abstract_space.py +++ b/src/sage/modular/modform_hecketriangle/abstract_space.py @@ -1963,7 +1963,7 @@ def construct_quasi_form(self, laurent_series, order_1=ZZ(0), check=True, ration sage: el == constructed_el True - If a q_basis is available the construction uses a different algorithm which we also check:: + If a q_basis is available the construction uses a different algorithm which we also check:: sage: basis = QF.q_basis(min_exp=-1) sage: QF(qexp) == constructed_el diff --git a/src/sage/modular/modform_hecketriangle/analytic_type.py b/src/sage/modular/modform_hecketriangle/analytic_type.py index 3b3b691e181..68adb2c513f 100644 --- a/src/sage/modular/modform_hecketriangle/analytic_type.py +++ b/src/sage/modular/modform_hecketriangle/analytic_type.py @@ -170,6 +170,8 @@ def analytic_name(self): r""" Return a string representation of the analytic type. + EXAMPLES:: + sage: from sage.modular.modform_hecketriangle.analytic_type import AnalyticType sage: AT = AnalyticType() sage: AT(["quasi", "weak"]).analytic_name() @@ -328,9 +330,9 @@ class AnalyticType(FiniteLatticePoset): sage: el.analytic_type() quasi modular - Similarly the type of the ring element ``el2 = E4/Delta - E6/Delta`` is - ``weakly holomorphic`` despite the fact that the sum (``el2``) describes - a function which is holomorphic at infinity. + Similarly the type of the ring element ``el2 = E4/Delta - E6/Delta`` is + ``weakly holomorphic`` despite the fact that the sum (``el2``) describes + a function which is holomorphic at infinity:: sage: from sage.modular.modform_hecketriangle.graded_ring import WeakModularFormsRing sage: x,y,z,d = var("x,y,z,d") diff --git a/src/sage/modules/fg_pid/fgp_element.py b/src/sage/modules/fg_pid/fgp_element.py index faf255b2ded..dbaeaf8c3e0 100644 --- a/src/sage/modules/fg_pid/fgp_element.py +++ b/src/sage/modules/fg_pid/fgp_element.py @@ -156,7 +156,7 @@ def _add_(self, other): sage: 0 + x (1, 0) - We test canonical coercion from V and W. + We test canonical coercion from V and W:: sage: Q.0 + V.0 (1, 8) diff --git a/src/sage/modules/torsion_quadratic_module.py b/src/sage/modules/torsion_quadratic_module.py index 45a6699a0cc..aba3df2211c 100644 --- a/src/sage/modules/torsion_quadratic_module.py +++ b/src/sage/modules/torsion_quadratic_module.py @@ -852,7 +852,7 @@ def orthogonal_group(self, gens=None, check=False): [1 0 0] [0 0 1] - We compute the kernel of the action of the orthogonal group of `L` on the discriminant group. + We compute the kernel of the action of the orthogonal group of `L` on the discriminant group:: sage: L = IntegralLattice('A4') sage: O = L.orthogonal_group() diff --git a/src/sage/numerical/linear_tensor.py b/src/sage/numerical/linear_tensor.py index 26d94b12cc6..34dc8e934ff 100644 --- a/src/sage/numerical/linear_tensor.py +++ b/src/sage/numerical/linear_tensor.py @@ -389,7 +389,7 @@ def _element_constructor_(self, x): sage: type(_) - Construct from scalar: + Construct from scalar:: sage: LT(123) # indirect doctest (123.0, 123.0) diff --git a/src/sage/plot/plot3d/plot3d.py b/src/sage/plot/plot3d/plot3d.py index 174765980f7..ff24627e81e 100644 --- a/src/sage/plot/plot3d/plot3d.py +++ b/src/sage/plot/plot3d/plot3d.py @@ -248,7 +248,7 @@ def __init__(self, dep_var, indep_vars): Because the base :class:`_Coordinates` class automatically checks the initializing variables with the transform method, :class:`_Coordinates` - cannot be instantiated by itself. We test a subclass. + cannot be instantiated by itself. We test a subclass:: sage: from sage.plot.plot3d.plot3d import _ArbitraryCoordinates as arb sage: x,y,z=var('x,y,z') diff --git a/src/sage/quadratic_forms/genera/genus.py b/src/sage/quadratic_forms/genera/genus.py index 0fc43f33c62..5451df7ae29 100644 --- a/src/sage/quadratic_forms/genera/genus.py +++ b/src/sage/quadratic_forms/genera/genus.py @@ -3045,7 +3045,7 @@ def representative(self): Genus symbol at 3: 1^3 3^1 A representative of ``g`` is not known yet. - Let us trigger its computation: + Let us trigger its computation:: sage: g.representative() [ 0 0 0 2] diff --git a/src/sage/quivers/morphism.py b/src/sage/quivers/morphism.py index b8bb25657eb..fc08e35ba60 100644 --- a/src/sage/quivers/morphism.py +++ b/src/sage/quivers/morphism.py @@ -1108,7 +1108,7 @@ def algebraic_dual(self): Representation with dimension vector (5, 2, 1, 1, 4) The algebraic dual of an indecomposable projective is the indecomposable - projective of the same vertex in the opposite quiver. + projective of the same vertex in the opposite quiver. :: sage: Q.reverse().P(QQ, 4) Representation with dimension vector (5, 2, 1, 1, 4) diff --git a/src/sage/repl/ipython_kernel/widgets_sagenb.py b/src/sage/repl/ipython_kernel/widgets_sagenb.py index 76f4f52ac4a..01a2bc42d06 100644 --- a/src/sage/repl/ipython_kernel/widgets_sagenb.py +++ b/src/sage/repl/ipython_kernel/widgets_sagenb.py @@ -91,7 +91,7 @@ def input_box(default=None, label=None, type=None, width=80, height=1): 9 With a different ``type``, the text is evaluated and ``type`` is - called on it: + called on it:: sage: w = input_box("4+5", type=float) sage: w @@ -470,7 +470,7 @@ def selector(values, label=None, default=None, nrows=None, ncols=None, width=Non sage: selector([(1,"one"), (2,"two"), (3,"three")], buttons=True) ToggleButtons(options=(('one', 1), ('two', 2), ('three', 3)), value=1) - The values can be any kind of object: + The values can be any kind of object:: sage: selector([sin(x^2), GF(29), EllipticCurve('37a1')]) Dropdown(options=(sin(x^2), Finite Field of size 29, Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field), value=sin(x^2)) diff --git a/src/sage/rings/lazy_series.py b/src/sage/rings/lazy_series.py index 51eeaf5d065..2e614e225ea 100644 --- a/src/sage/rings/lazy_series.py +++ b/src/sage/rings/lazy_series.py @@ -3975,7 +3975,7 @@ def derivative(self, *args): TESTS: - Check the derivative of the logarithm: + Check the derivative of the logarithm:: sage: L. = LazyLaurentSeriesRing(QQ) sage: -log(1-z).derivative() diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py index 0d2271844ca..9eb6c7ce39b 100644 --- a/src/sage/rings/number_field/number_field.py +++ b/src/sage/rings/number_field/number_field.py @@ -1708,7 +1708,7 @@ def _element_constructor_(self, x, check=True): a^2 An error is raised when a PARI element with an incorrect - modulus is given: + modulus is given:: sage: K(pari("Mod(-5/3*q^2 + 5/3*q - 1/6, q^3 - 999)")) Traceback (most recent call last): @@ -8693,8 +8693,8 @@ def _subfields_helper(self, degree=0, name=None, both_maps=True, optimize=False) (Number Field in a0 with defining polynomial x^2 - 23 with a0 = -4.795831523312720?, -4.795831523312719) - If we take a different embedding of the large field, we get a - different embedding of the degree 2 subfield:: + If we take a different embedding of the large field, we get a + different embedding of the degree 2 subfield:: sage: K. = NumberField(x^4 - 23, embedding=-50) sage: L2, _, _ = K.subfields(2)[0]; L2, CDF(L2.gen()) # indirect doctest diff --git a/src/sage/rings/number_field/number_field_ideal_rel.py b/src/sage/rings/number_field/number_field_ideal_rel.py index 192c8f15034..1292219f843 100644 --- a/src/sage/rings/number_field/number_field_ideal_rel.py +++ b/src/sage/rings/number_field/number_field_ideal_rel.py @@ -170,7 +170,7 @@ def absolute_ideal(self, names = 'a'): sage: J.absolute_ideal().norm() 4 - Now pass 'm' as the name for the generator of the absolute field: + Now pass 'm' as the name for the generator of the absolute field:: sage: J.absolute_ideal('m') Fractional ideal (m^2) diff --git a/src/sage/rings/number_field/structure.py b/src/sage/rings/number_field/structure.py index f933affe775..52e6ed6d503 100644 --- a/src/sage/rings/number_field/structure.py +++ b/src/sage/rings/number_field/structure.py @@ -151,7 +151,7 @@ class NameChange(NumberFieldStructure): sage: NameChange(K) - Check for memory leaks: + Check for memory leaks:: sage: u=id(NumberField(x^2-5,'a').absolute_field('b')) sage: import gc diff --git a/src/sage/rings/padics/CR_template.pxi b/src/sage/rings/padics/CR_template.pxi index 1b3134f3195..73f87ed27e9 100644 --- a/src/sage/rings/padics/CR_template.pxi +++ b/src/sage/rings/padics/CR_template.pxi @@ -905,13 +905,13 @@ cdef class CRElement(pAdicTemplateElement): sage: b = R(0); b.add_bigoh(3) O(7^3) - The precision never increases:: + The precision never increases:: sage: R(4).add_bigoh(2).add_bigoh(4) 4 + O(7^2) - Another example that illustrates that the precision does - not increase:: + Another example that illustrates that the precision does + not increase:: sage: k = Qp(3,5) sage: a = k(1234123412/3^70); a diff --git a/src/sage/rings/padics/factory.py b/src/sage/rings/padics/factory.py index 3e396efa8ac..7930b806784 100644 --- a/src/sage/rings/padics/factory.py +++ b/src/sage/rings/padics/factory.py @@ -3019,7 +3019,7 @@ def ZpER(p, prec=None, halt=None, secure=False, *args, **kwds): 40 However, both the default precision and the halting precision can be - customized at the creation of the parent as follows: + customized at the creation of the parent as follows:: sage: S = ZpER(5, prec=10, halt=100) sage: S.default_prec() diff --git a/src/sage/rings/padics/lattice_precision.py b/src/sage/rings/padics/lattice_precision.py index 654ba06bfe7..e9966629fdf 100644 --- a/src/sage/rings/padics/lattice_precision.py +++ b/src/sage/rings/padics/lattice_precision.py @@ -974,7 +974,7 @@ def precision_lattice(self, elements=None): [ 0 2048] If the precision module does not project to a lattice, - an error is raised. + an error is raised. :: sage: R = ZpLF(2, label='precision_lattice') sage: prec = R.precision() @@ -2689,7 +2689,7 @@ def precision_lattice(self, elements=None): [ 0 2048] If the precision module does not project to a lattice, - an error is raised. + an error is raised. :: sage: prec.precision_lattice([x, y, u, v]) Traceback (most recent call last): diff --git a/src/sage/rings/padics/padic_base_leaves.py b/src/sage/rings/padics/padic_base_leaves.py index 3930103df75..7963a442f97 100644 --- a/src/sage/rings/padics/padic_base_leaves.py +++ b/src/sage/rings/padics/padic_base_leaves.py @@ -904,7 +904,7 @@ def _coerce_map_from_(self, R): True Note that coerce map does not exist between ``p``-adic rings with - lattice precision and other ``p``-adic rings. + lattice precision and other ``p``-adic rings. :: sage: S = Zp(2) sage: R.has_coerce_map_from(S) @@ -913,7 +913,7 @@ def _coerce_map_from_(self, R): False Similarly there is no coercion maps between ``p``-adic rings with - different labels. + different labels. :: sage: R2 = ZpLC(2, label='coerce') sage: R.has_coerce_map_from(R2) @@ -1033,7 +1033,7 @@ def _coerce_map_from_(self, R): True Note that coerce map does not exist between ``p``-adic fields with - lattice precision and other ``p``-adic rings. + lattice precision and other ``p``-adic rings. :: sage: L = Qp(2) sage: K.has_coerce_map_from(L) diff --git a/src/sage/rings/padics/padic_extension_generic.py b/src/sage/rings/padics/padic_extension_generic.py index ff2d0a5ec6c..b93c404f660 100644 --- a/src/sage/rings/padics/padic_extension_generic.py +++ b/src/sage/rings/padics/padic_extension_generic.py @@ -510,7 +510,7 @@ def construction(self, forbid_frac_field=False): sage: c(R0) == R True - For a field, by default we return a fraction field functor. + For a field, by default we return a fraction field functor. :: sage: K. = Qq(25, 8) sage: c, R = K.construction(); R diff --git a/src/sage/rings/padics/padic_lattice_element.py b/src/sage/rings/padics/padic_lattice_element.py index 3518ce86c67..141af863ef5 100644 --- a/src/sage/rings/padics/padic_lattice_element.py +++ b/src/sage/rings/padics/padic_lattice_element.py @@ -1010,7 +1010,7 @@ def unit_part(self): sage: b.unit_part() 1 + 16*17 + O(17^3) - If the element is indistinguishable from zero, an error is raised. + If the element is indistinguishable from zero, an error is raised:: sage: c = R(0, 5); c O(17^5) diff --git a/src/sage/rings/padics/padic_valuation.py b/src/sage/rings/padics/padic_valuation.py index 2d444d0e676..8f50283d1fa 100644 --- a/src/sage/rings/padics/padic_valuation.py +++ b/src/sage/rings/padics/padic_valuation.py @@ -439,7 +439,7 @@ class pAdicValuation_base(DiscreteValuation): sage: QQ.valuation(5) 5-adic valuation - For `p`-adic rings, ``p`` has to match the `p` of the ring. + For `p`-adic rings, ``p`` has to match the `p` of the ring. :: sage: v = valuations.pAdicValuation(Zp(3), 2); v Traceback (most recent call last): diff --git a/src/sage/rings/polynomial/infinite_polynomial_ring.py b/src/sage/rings/polynomial/infinite_polynomial_ring.py index ff237743f4a..01aaed803b9 100644 --- a/src/sage/rings/polynomial/infinite_polynomial_ring.py +++ b/src/sage/rings/polynomial/infinite_polynomial_ring.py @@ -646,7 +646,7 @@ class InfinitePolynomialRing_sparse(CommutativeRing): sage: Z = InfinitePolynomialRing_sparse(QQ, ['x','y'], 'lex') Nevertheless, since infinite polynomial rings are supposed to be unique - parent structures, they do not evaluate equal. + parent structures, they do not evaluate equal. :: sage: Z == X False diff --git a/src/sage/rings/polynomial/laurent_polynomial_ideal.py b/src/sage/rings/polynomial/laurent_polynomial_ideal.py index 76d1b495274..0168a56e267 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ideal.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ideal.py @@ -103,6 +103,8 @@ def set_hint(self, hint): to speed up computation of the associated ideal in some cases; normally the end user will have no need to work with it directly. + EXAMPLES:: + sage: P. = LaurentPolynomialRing(QQ, 3) sage: I = P.ideal([x^2*y + 3*x*y^2]) sage: I.hint() diff --git a/src/sage/rings/polynomial/laurent_polynomial_ring.py b/src/sage/rings/polynomial/laurent_polynomial_ring.py index c10faf46568..0ec8ecb15f7 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ring.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ring.py @@ -731,7 +731,7 @@ def ideal(self, *args, **kwds): TESTS: - check that :trac:`26421` is fixed: + check that :trac:`26421` is fixed:: sage: R. = LaurentPolynomialRing(ZZ) sage: P. = PolynomialRing(R) diff --git a/src/sage/rings/polynomial/ore_function_element.py b/src/sage/rings/polynomial/ore_function_element.py index d21ed8d1ed4..fe87008cf2c 100644 --- a/src/sage/rings/polynomial/ore_function_element.py +++ b/src/sage/rings/polynomial/ore_function_element.py @@ -845,7 +845,7 @@ def reduced_trace(self, var=None): 3/(z^2 + 2) The reduced trace lies in the center of `S`, which is the fraction field - of a univariate polynomial ring in the variable `z = x^3` over `GF(5)`. + of a univariate polynomial ring in the variable `z = x^3` over `GF(5)`:: sage: tr.parent() Fraction Field of Univariate Polynomial Ring in z over Finite Field of size 5 @@ -906,7 +906,7 @@ def reduced_norm(self, var=None): (z + 2)/(z^2 + 4) The reduced norm lies in the center of `S`, which is the fraction field - of a univariate polynomial ring in the variable `z = x^3` over `GF(5)`. + of a univariate polynomial ring in the variable `z = x^3` over `GF(5)`. :: sage: N.parent() Fraction Field of Univariate Polynomial Ring in z over Finite Field of size 5 diff --git a/src/sage/rings/polynomial/ore_function_field.py b/src/sage/rings/polynomial/ore_function_field.py index f223f9799dd..34e6e2a6756 100644 --- a/src/sage/rings/polynomial/ore_function_field.py +++ b/src/sage/rings/polynomial/ore_function_field.py @@ -35,7 +35,7 @@ sage: g (d - 1/t)^(-1) * t -The left numerator and right denominator are accessible as follows: +The left numerator and right denominator are accessible as follows:: sage: g.left_numerator() t diff --git a/src/sage/rings/polynomial/pbori/ll.py b/src/sage/rings/polynomial/pbori/ll.py index b12985797a7..a48e7e2a84a 100644 --- a/src/sage/rings/polynomial/pbori/ll.py +++ b/src/sage/rings/polynomial/pbori/ll.py @@ -284,6 +284,8 @@ def invert(self, poly): r""" Inverted map to initial ring. + EXAMPLES:: + sage: from sage.rings.polynomial.pbori.pbori import * sage: from sage.rings.polynomial.pbori.blocks import declare_ring, Block sage: to_ring = declare_ring([Block("x", 10)], globals()) diff --git a/src/sage/rings/polynomial/polynomial_ring.py b/src/sage/rings/polynomial/polynomial_ring.py index c7e9a7f9dbf..74e6b061a09 100644 --- a/src/sage/rings/polynomial/polynomial_ring.py +++ b/src/sage/rings/polynomial/polynomial_ring.py @@ -1862,7 +1862,7 @@ def weil_polynomials(self, d, q, sign=1, lead=1): sage: all(p.is_weil_polynomial() for p in L) True - Setting multiple leading coefficients: + Setting multiple leading coefficients:: sage: R. = QQ[] sage: l = R.weil_polynomials(4,2,lead=((1,0),(2,4),(1,2))) diff --git a/src/sage/rings/polynomial/term_order.py b/src/sage/rings/polynomial/term_order.py index 212f5cb0d73..bda1ec75a10 100644 --- a/src/sage/rings/polynomial/term_order.py +++ b/src/sage/rings/polynomial/term_order.py @@ -1790,7 +1790,7 @@ def singular_moreblocks(self): TESTS: The 'degneglex' ordering is somehow special: SINGULAR handles it - using an extra weight vector block. + using an extra weight vector block. :: sage: T = TermOrder("degneglex", 2) sage: P = PolynomialRing(QQ,2, names='x', order=T) diff --git a/src/sage/schemes/affine/affine_morphism.py b/src/sage/schemes/affine/affine_morphism.py index 32c2e47e494..0c489c65794 100644 --- a/src/sage/schemes/affine/affine_morphism.py +++ b/src/sage/schemes/affine/affine_morphism.py @@ -158,7 +158,7 @@ def __init__(self, parent, polys, check=True): Defn: Defined on coordinates by sending (x, y) to ((5*x^3 + 3*x*y^2 - y^3)/(x^3 - 1), (x^2*y + 3)/(x^3 - 1)) - If you pass in quotient ring elements, they are reduced:: + If you pass in quotient ring elements, they are reduced:: sage: A. = AffineSpace(QQ, 3) sage: X = A.subscheme([x-y]) @@ -171,7 +171,7 @@ def __init__(self, parent, polys, check=True): Defn: Defined on coordinates by sending (x, y, z) to (y, y, 2*y) - You must use the ambient space variables to create rational functions:: + You must use the ambient space variables to create rational functions:: sage: A. = AffineSpace(QQ, 3) sage: X = A.subscheme([x^2-y^2]) diff --git a/src/sage/schemes/elliptic_curves/ell_finite_field.py b/src/sage/schemes/elliptic_curves/ell_finite_field.py index ff69f92f6ca..7fb65f32c8c 100644 --- a/src/sage/schemes/elliptic_curves/ell_finite_field.py +++ b/src/sage/schemes/elliptic_curves/ell_finite_field.py @@ -1125,7 +1125,7 @@ def is_isogenous(self, other, field=None, proof=True): ... ValueError: Curves have different base fields: use the field parameter. - When the field is given: + When the field is given:: sage: E1 = EllipticCurve(GF(13^2,'a'),[2,7]); E1 Elliptic Curve defined by y^2 = x^3 + 2*x + 7 over Finite Field in a of size 13^2 diff --git a/src/sage/schemes/elliptic_curves/hom_velusqrt.py b/src/sage/schemes/elliptic_curves/hom_velusqrt.py index 22ae56018a3..6ed7a5c3d15 100644 --- a/src/sage/schemes/elliptic_curves/hom_velusqrt.py +++ b/src/sage/schemes/elliptic_curves/hom_velusqrt.py @@ -515,7 +515,7 @@ def _point_outside_subgroup(P): ... ValueError: ECDLog problem has no solution (...) - An example where the group is non-cyclic: + An example where the group is non-cyclic:: sage: E. = EllipticCurve(GF(71^2), [0,1]) sage: E.abelian_group() diff --git a/src/sage/sets/finite_set_maps.py b/src/sage/sets/finite_set_maps.py index ce5029d8032..ffe885e2977 100644 --- a/src/sage/sets/finite_set_maps.py +++ b/src/sage/sets/finite_set_maps.py @@ -305,7 +305,7 @@ def an_element(self): An exception :class:`~sage.categories.sets_cat.EmptySetError` is raised if this set is empty, that is if the codomain is - empty and the domain is not. + empty and the domain is not. :: sage: M = FiniteSetMaps(4, 0) sage: M.cardinality() diff --git a/src/sage/sets/set.py b/src/sage/sets/set.py index b988525a880..e0c640040ca 100644 --- a/src/sage/sets/set.py +++ b/src/sage/sets/set.py @@ -616,7 +616,7 @@ def __contains__(self, x): False Finite fields better illustrate the difference between - ``__contains__`` for objects and their underlying sets. + ``__contains__`` for objects and their underlying sets:: sage: X = Set(GF(7)) sage: X diff --git a/src/sage/symbolic/operators.py b/src/sage/symbolic/operators.py index a48b0e8e393..2f700ea298f 100644 --- a/src/sage/symbolic/operators.py +++ b/src/sage/symbolic/operators.py @@ -169,6 +169,8 @@ def change_function(self, new): Return a new function derivative operator with the same parameter set but for a new function. + EXAMPLES:: + sage: from sage.symbolic.operators import FDerivativeOperator sage: f = function('foo') sage: b = function('bar')