Skip to content

Commit cba7b31

Browse files
committed
update doctests for cython 3
1 parent 326f36e commit cba7b31

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

src/doc/en/thematic_tutorials/coercion_and_categories.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ it makes sense to build on top of the base class
105105
This base class provides a lot more methods than a general parent::
106106

107107
sage: [p for p in dir(Field) if p not in dir(Parent)]
108-
['__fraction_field',
108+
['_CommutativeRing__fraction_field',
109109
'__iter__',
110110
'__len__',
111111
'__rxor__',

src/sage/arith/srange.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def xsrange(start, end=None, step=1, universe=None, *, coerce=True, bint include
8484
EXAMPLES::
8585
8686
sage: xsrange(10)
87-
<generator object at 0x...>
87+
<...generator object at 0x...>
8888
sage: for i in xsrange(1,5):
8989
....: print(i)
9090
1

src/sage/combinat/sloane_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9169,7 +9169,7 @@ def __getattribute__(self, name):
91699169
::
91709170
91719171
sage: sloane.__repr__
9172-
<method-wrapper '__repr__' of Sloane object at 0x...>
9172+
<built-in method __repr__ of Sloane object at 0x...>
91739173
sage: sloane.__name__
91749174
Traceback (most recent call last):
91759175
...

src/sage/misc/cachefunc.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ be used::
5050
sage: cython('''cpdef test_funct(x): return -x''')
5151
sage: wrapped_funct = cached_function(test_funct, name='wrapped_funct')
5252
sage: wrapped_funct
53-
Cached version of <built-in function test_funct>
53+
Cached version of <cyfunction test_funct at ...>
5454
sage: wrapped_funct.__name__
5555
'wrapped_funct'
5656
sage: wrapped_funct(5)
@@ -82,9 +82,9 @@ approach is still needed for cpdef methods::
8282
sage: cython(os.linesep.join(cython_code))
8383
sage: O = MyClass()
8484
sage: O.direct_method
85-
Cached version of <method 'direct_method' of '...MyClass' objects>
85+
Cached version of <cyfunction MyClass.direct_method at ...>
8686
sage: O.wrapped_method
87-
Cached version of <built-in function test_meth>
87+
Cached version of <cyfunction test_meth at ...>
8888
sage: O.wrapped_method.__name__
8989
'wrapped_method'
9090
sage: O.wrapped_method(5)
@@ -270,6 +270,7 @@ Introspection works::
270270
"some doc for a wrapped cython method"
271271
return -x
272272
sage: print(sage_getsource(O.direct_method))
273+
@cached_method
273274
def direct_method(self, x):
274275
"Some doc for direct method"
275276
return 2*x

src/sage/misc/lazy_import.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ def lazy_import(module, names, as_=None, *,
10951095
sage: lazy_import('ppl', 'equation',
10961096
....: feature=PythonModule('ppl', spkg='pplpy', type='standard'))
10971097
sage: equation # needs pplpy
1098-
<built-in function equation>
1098+
<cyfunction equation at ...>
10991099
sage: lazy_import('PyNormaliz', 'NmzListConeProperties', feature=PythonModule('PyNormaliz', spkg='pynormaliz')) # optional - pynormaliz
11001100
sage: NmzListConeProperties # optional - pynormaliz
11011101
<built-in function NmzListConeProperties>

src/sage/misc/lazy_list.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ cdef class lazy_list_generic():
678678
sage: from itertools import count
679679
sage: from sage.misc.lazy_list import lazy_list
680680
sage: iter(lazy_list(count()))
681-
<generator object at 0x...>
681+
<...generator object at 0x...>
682682
683683
::
684684

src/sage/misc/sageinspect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
sage: sage_getdoc(sage.rings.rational.make_rational).lstrip()
7777
'Make a rational number ...'
7878
79-
sage: sage_getsource(sage.rings.rational.make_rational)[4:]
80-
'make_rational(s):...'
79+
sage: sage_getsource(sage.rings.rational.make_rational)
80+
'@cython.binding(True)\ndef make_rational(s):...'
8181
8282
Python functions::
8383

src/sage/modules/free_module_element.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
16341634
16351635
sage: v = vector([1,2/3,pi]) # needs sage.symbolic
16361636
sage: v.items() # needs sage.symbolic
1637-
<generator object at ...>
1637+
<...generator object at ...>
16381638
sage: list(v.items()) # needs sage.symbolic
16391639
[(0, 1), (1, 2/3), (2, pi)]
16401640

src/sage/rings/finite_rings/finite_field_base.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ cdef class FiniteField(Field):
328328
sage: p = next_prime(2^64)
329329
sage: k.<a> = FiniteField(p^2, impl="pari")
330330
sage: it = iter(k); it
331-
<generator object at ...>
331+
<...generator object at ...>
332332
sage: [next(it) for i in range(10)]
333333
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
334334

src/sage/rings/polynomial/skew_polynomial_finite_field.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ cdef class SkewPolynomial_finite_field_dense(SkewPolynomial_finite_order_dense):
629629
sage: S.<x> = k['x',Frob]
630630
sage: a = x^4 + 2*t*x^3 + 3*t^2*x^2 + (t^2 + t + 1)*x + 4*t + 3
631631
sage: iter = a.right_irreducible_divisors(); iter
632-
<generator object at 0x...>
632+
<...generator object at 0x...>
633633
sage: next(iter) # random
634634
x + 2*t^2 + 4*t + 4
635635
sage: next(iter) # random
@@ -664,7 +664,7 @@ cdef class SkewPolynomial_finite_field_dense(SkewPolynomial_finite_order_dense):
664664
sage: S.<x> = k['x',Frob]
665665
sage: a = x^4 + 2*t*x^3 + 3*t^2*x^2 + (t^2 + t + 1)*x + 4*t + 3
666666
sage: iter = a.left_irreducible_divisors(); iter
667-
<generator object at 0x...>
667+
<...generator object at 0x...>
668668
sage: next(iter) # random
669669
x + 3*t + 3
670670
sage: next(iter) # random
@@ -1052,7 +1052,7 @@ cdef class SkewPolynomial_finite_field_dense(SkewPolynomial_finite_order_dense):
10521052
sage: S.<x> = k['x',Frob]
10531053
sage: a = x^3 + (t^2 + 1)*x^2 + (2*t + 3)*x + t^2 + t + 2
10541054
sage: iter = a.factorizations(); iter
1055-
<generator object at 0x...>
1055+
<...generator object at 0x...>
10561056
sage: next(iter) # random
10571057
(x + 3*t^2 + 4*t) * (x + 2*t^2) * (x + 4*t^2 + 4*t + 2)
10581058
sage: next(iter) # random

0 commit comments

Comments
 (0)