13
cdef static_cdef(int* x):
17
cdef static_cdef2(int* x, int* y):
18
return 'cdef2', x[0] + y[0]
21
cdef static_cdef_untyped(a, b):
22
return 'cdef_utyped', a, b
25
# cpdef static_cpdef(int x):
33
# >>> A.static_cpdef(2)
35
# >>> A().static_cpdef(2)
40
def call_static_def(int x):
42
>>> call_static_def(2)
45
return A.static_def(x)
47
def call_static_cdef(int x):
49
>>> call_static_cdef(2)
53
return A.static_cdef(x_ptr)
55
def call_static_cdef2(int x, int y):
57
>>> call_static_cdef2(2, 3)
60
return A.static_cdef2(&x, &y)
62
def call_static_list_comprehension_GH1540(int x):
64
>>> call_static_list_comprehension_GH1540(5)
65
[('cdef', 5), ('cdef', 5), ('cdef', 5)]
67
return [A.static_cdef(&x) for _ in range(3)]
70
#def call_static_cdef_untyped(a, b):
72
# >>> call_static_cdef_untyped(100, None)
73
# ('cdef_untyped', 100, None)
75
# return A.static_cdef_untyped(a, b)
78
# def call_static_cpdef(int x):
80
# >>> call_static_cpdef(2)
83
# return A.static_cpdef(x)
87
cdef static_cdef(int* x):
88
return 'pxd_cdef', x[0]
91
cdef static_cdef_with_implicit_object(obj):
94
def call_static_pxd_cdef(int x):
96
>>> call_static_pxd_cdef(2)
100
return FromPxd.static_cdef(x_ptr)
102
def call_static_pxd_cdef_with_implicit_object(int x):
104
# https://github.com/cython/cython/issues/3174
105
>>> call_static_pxd_cdef_with_implicit_object(2)
108
return FromPxd.static_cdef_with_implicit_object(x)