diff --git a/src/doc/en/thematic_tutorials/coercion_and_categories.rst b/src/doc/en/thematic_tutorials/coercion_and_categories.rst index de2349a9a3f..bb23331c151 100644 --- a/src/doc/en/thematic_tutorials/coercion_and_categories.rst +++ b/src/doc/en/thematic_tutorials/coercion_and_categories.rst @@ -105,7 +105,7 @@ it makes sense to build on top of the base class This base class provides a lot more methods than a general parent:: sage: [p for p in dir(Field) if p not in dir(Parent)] - ['__fraction_field', + ['_CommutativeRing__fraction_field', '__iter__', '__len__', '__rxor__', diff --git a/src/sage/arith/srange.pyx b/src/sage/arith/srange.pyx index c21a43c0ee1..d74f064ab44 100644 --- a/src/sage/arith/srange.pyx +++ b/src/sage/arith/srange.pyx @@ -84,7 +84,7 @@ def xsrange(start, end=None, step=1, universe=None, *, coerce=True, bint include EXAMPLES:: sage: xsrange(10) - + <_cython_3_0_0.generator object at 0x...> sage: for i in xsrange(1,5): ....: print(i) 1 diff --git a/src/sage/combinat/sloane_functions.py b/src/sage/combinat/sloane_functions.py index ba937db12ff..053777887a5 100644 --- a/src/sage/combinat/sloane_functions.py +++ b/src/sage/combinat/sloane_functions.py @@ -9171,7 +9171,7 @@ def __getattribute__(self, name): :: sage: sloane.__repr__ - + sage: sloane.__name__ Traceback (most recent call last): ... diff --git a/src/sage/misc/cachefunc.pyx b/src/sage/misc/cachefunc.pyx index 413228c4e3a..5793a5bc0ef 100644 --- a/src/sage/misc/cachefunc.pyx +++ b/src/sage/misc/cachefunc.pyx @@ -49,7 +49,7 @@ be used:: sage: cython('''cpdef test_funct(x): return -x''') # optional - sage.misc.cython sage: wrapped_funct = cached_function(test_funct, name='wrapped_funct') # optional - sage.misc.cython sage: wrapped_funct # optional - sage.misc.cython - Cached version of + Cached version of sage: wrapped_funct.__name__ # optional - sage.misc.cython 'wrapped_funct' sage: wrapped_funct(5) # optional - sage.misc.cython @@ -80,9 +80,9 @@ approach is still needed for cpdef methods:: sage: cython(os.linesep.join(cython_code)) # optional - sage.misc.cython sage: O = MyClass() # optional - sage.misc.cython sage: O.direct_method # optional - sage.misc.cython - Cached version of + Cached version of sage: O.wrapped_method # optional - sage.misc.cython - Cached version of + Cached version of sage: O.wrapped_method.__name__ # optional - sage.misc.cython 'wrapped_method' sage: O.wrapped_method(5) # optional - sage.misc.cython @@ -263,6 +263,7 @@ Introspection works:: "some doc for a wrapped cython method" return -x sage: print(sage_getsource(O.direct_method)) # optional - sage.misc.cython + @cached_method def direct_method(self, x): "Some doc for direct method" return 2*x diff --git a/src/sage/misc/lazy_import.pyx b/src/sage/misc/lazy_import.pyx index 3de82a88eaf..a204a04a5e0 100644 --- a/src/sage/misc/lazy_import.pyx +++ b/src/sage/misc/lazy_import.pyx @@ -1091,7 +1091,7 @@ def lazy_import(module, names, as_=None, *, sage: from sage.features import PythonModule sage: lazy_import('ppl', 'equation', feature=PythonModule('ppl', spkg='pplpy', type='standard')) sage: equation - + sage: lazy_import('PyNormaliz', 'NmzListConeProperties', feature=PythonModule('PyNormaliz', spkg='pynormaliz')) # optional - pynormaliz sage: NmzListConeProperties # optional - pynormaliz diff --git a/src/sage/misc/lazy_list.pyx b/src/sage/misc/lazy_list.pyx index acaaaf887c7..aae32eafe3c 100644 --- a/src/sage/misc/lazy_list.pyx +++ b/src/sage/misc/lazy_list.pyx @@ -677,7 +677,7 @@ cdef class lazy_list_generic(): sage: from itertools import count sage: from sage.misc.lazy_list import lazy_list sage: iter(lazy_list(count())) - + <_cython_3_0_0.generator object at 0x...> :: diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py index 26f0f83ff74..2eae8a99f2c 100644 --- a/src/sage/misc/sageinspect.py +++ b/src/sage/misc/sageinspect.py @@ -76,8 +76,8 @@ sage: sage_getdoc(sage.rings.rational.make_rational).lstrip() 'Make a rational number ...' - sage: sage_getsource(sage.rings.rational.make_rational)[4:] - 'make_rational(s):...' + sage: sage_getsource(sage.rings.rational.make_rational) + '@cython.binding(True)\ndef make_rational(s):...' Python functions:: diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx index f813b37cf70..26f974f53f5 100644 --- a/src/sage/modules/free_module_element.pyx +++ b/src/sage/modules/free_module_element.pyx @@ -1612,7 +1612,7 @@ cdef class FreeModuleElement(Vector): # abstract base class sage: v = vector([1,2/3,pi]) sage: v.items() - + <_cython_3_0_0.generator object at ...> sage: list(v.items()) [(0, 1), (1, 2/3), (2, pi)] diff --git a/src/sage/rings/finite_rings/finite_field_base.pyx b/src/sage/rings/finite_rings/finite_field_base.pyx index 7e2eed91153..be2bc4d524c 100644 --- a/src/sage/rings/finite_rings/finite_field_base.pyx +++ b/src/sage/rings/finite_rings/finite_field_base.pyx @@ -328,7 +328,7 @@ cdef class FiniteField(Field): sage: p = next_prime(2^64) sage: k. = FiniteField(p^2, impl="pari") sage: it = iter(k); it - + <_cython_3_0_0.generator object at ...> sage: [next(it) for i in range(10)] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] diff --git a/src/sage/rings/polynomial/skew_polynomial_finite_field.pyx b/src/sage/rings/polynomial/skew_polynomial_finite_field.pyx index 1d539c93f48..99c11d1c5fc 100644 --- a/src/sage/rings/polynomial/skew_polynomial_finite_field.pyx +++ b/src/sage/rings/polynomial/skew_polynomial_finite_field.pyx @@ -629,7 +629,7 @@ cdef class SkewPolynomial_finite_field_dense(SkewPolynomial_finite_order_dense): sage: S. = k['x',Frob] sage: a = x^4 + 2*t*x^3 + 3*t^2*x^2 + (t^2 + t + 1)*x + 4*t + 3 sage: iter = a.right_irreducible_divisors(); iter - + <_cython_3_0_0.generator object at 0x...> sage: next(iter) # random x + 2*t^2 + 4*t + 4 sage: next(iter) # random @@ -664,7 +664,7 @@ cdef class SkewPolynomial_finite_field_dense(SkewPolynomial_finite_order_dense): sage: S. = k['x',Frob] sage: a = x^4 + 2*t*x^3 + 3*t^2*x^2 + (t^2 + t + 1)*x + 4*t + 3 sage: iter = a.left_irreducible_divisors(); iter - + <_cython_3_0_0.generator object at 0x...> sage: next(iter) # random x + 3*t + 3 sage: next(iter) # random @@ -1052,7 +1052,7 @@ cdef class SkewPolynomial_finite_field_dense(SkewPolynomial_finite_order_dense): sage: S. = k['x',Frob] sage: a = x^3 + (t^2 + 1)*x^2 + (2*t + 3)*x + t^2 + t + 2 sage: iter = a.factorizations(); iter - + <_cython_3_0_0.generator object at 0x...> sage: next(iter) # random (x + 3*t^2 + 4*t) * (x + 2*t^2) * (x + 4*t^2 + 4*t + 2) sage: next(iter) # random diff --git a/src/sage/structure/coerce_dict.pyx b/src/sage/structure/coerce_dict.pyx index d38997d807c..9689787b514 100644 --- a/src/sage/structure/coerce_dict.pyx +++ b/src/sage/structure/coerce_dict.pyx @@ -776,7 +776,7 @@ cdef class MonoDict: sage: L[1] = None sage: L[2] = True sage: L.items() - + <_cython_3_0_0.generator object at ...> sage: sorted(L.items()) [(1, None), (2, True)] """ @@ -1451,7 +1451,7 @@ cdef class TripleDict: sage: L = TripleDict() sage: L[1,2,3] = None sage: L.items() - + <_cython_3_0_0.generator object at ...> sage: list(L.items()) [((1, 2, 3), None)] """ diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py index bfb3dfabf3e..0a0572acbfd 100644 --- a/src/sage/tests/cmdline.py +++ b/src/sage/tests/cmdline.py @@ -491,9 +491,8 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False sage: (out, err, ret) = test_executable(["sage", "--cython"]) sage: print(err) - Cython (http://cython.org) is a compiler for code written in the - Cython language. Cython is based on Pyrex by Greg Ewing. ... + cython: error: cython: Need at least one source file sage: def has_tty(): ....: try: