Cython has moved to github.

cython-devel

view tests/run/embedsignatures.pyx @ 1622:4f0327bdebc9

test for temp allocation bug in call
author Robert Bradshaw <robertwb@math.washington.edu>
date Sat Jan 17 01:25:34 2009 -0800 (3 years ago)
parents 31644ed14440
children 59bbd4b0941c
line source
1 #cython: embedsignature=True
3 # note the r, we use \n below
4 __doc__ = ur"""
5 >>> print (Ext.__doc__)
6 Ext(a, b, c=None)
8 >>> print (Ext.a.__doc__)
9 Ext.a(self)
11 >>> print (Ext.b.__doc__)
12 Ext.b(self, a, b, c)
14 >>> print (Ext.c.__doc__)
15 Ext.c(self, a, b, c=1)
17 >>> print (Ext.d.__doc__)
18 Ext.d(self, a, b, *, c=88)
20 >>> print (Ext.e.__doc__)
21 Ext.e(self, a, b, c=88, **kwds)
23 >>> print (Ext.f.__doc__)
24 Ext.f(self, a, b, *, c, d=42)
26 >>> print (Ext.g.__doc__)
27 Ext.g(self, a, b, *, c, d=42, e=17, f, **kwds)
29 >>> print (Ext.h.__doc__)
30 Ext.h(self, a, b, *args, c, d=42, e=17, f, **kwds)
32 >>> print (Ext.k.__doc__)
33 Ext.k(self, a, b, c=1, *args, d=42, e=17, f, **kwds)
35 >>> print (Ext.l.__doc__)
36 Ext.l(self, a, b, c=1, *args, d=42, e=17, f, **kwds)
37 Existing string
39 >>> print (Ext.get_int.__doc__)
40 Ext.get_int(self) -> int
42 >>> print (Ext.get_float.__doc__)
43 Ext.get_float(self) -> float
45 >>> print (Ext.get_str.__doc__)
46 Ext.get_str(self) -> str
47 Existing string
49 >>> print (Ext.clone.__doc__)
50 Ext.clone(self) -> Ext
52 >>> print (foo.__doc__)
53 foo()
55 >>> with_doc_1.__doc__
56 'with_doc_1(a, b, c)\nExisting string'
58 >>> with_doc_2.__doc__
59 'with_doc_2(a, b, c)\n\n Existing string\n '
61 >>> with_doc_3.__doc__
62 'with_doc_3(a, b, c)\nExisting string'
64 >>> with_doc_4.__doc__
65 'with_doc_4(int a, str b, list c) -> str\n\n Existing string\n '
67 >>> types.__doc__
68 'types(Ext a, int b, unsigned short c, float d, e)'
70 >>> print (f_c.__doc__)
71 f_c(char c) -> char
73 >>> print (f_uc.__doc__)
74 f_uc(unsigned char c) -> unsigned char
76 >>> print (f_sc.__doc__)
77 f_sc(signed char c) -> signed char
80 >>> print (f_s.__doc__)
81 f_s(short s) -> short
83 >>> print (f_us.__doc__)
84 f_us(unsigned short s) -> unsigned short
86 >>> print (f_ss.__doc__)
87 f_ss(signed short s) -> signed short
90 >>> print (f_i.__doc__)
91 f_i(int i) -> int
93 >>> print (f_ui.__doc__)
94 f_ui(unsigned int i) -> unsigned int
96 >>> print (f_si.__doc__)
97 f_si(signed int i) -> signed int
100 >>> print (f_l.__doc__)
101 f_l(long l) -> long
103 >>> print (f_ul.__doc__)
104 f_ul(unsigned long l) -> unsigned long
106 >>> print (f_sl.__doc__)
107 f_sl(signed long l) -> signed long
110 >>> print (f_L.__doc__)
111 f_L(long long L) -> long long
113 >>> print (f_uL.__doc__)
114 f_uL(unsigned long long L) -> unsigned long long
116 >>> print (f_sL.__doc__)
117 f_sL(signed long long L) -> signed long long
120 >>> print (f_f.__doc__)
121 f_f(float f) -> float
123 >>> print (f_d.__doc__)
124 f_d(double d) -> double
126 >>> print (f_D.__doc__)
127 f_D(long double D) -> long double
129 """
131 cdef class Ext:
133 def __init__(self, a, b, c=None):
134 pass
136 def a(self):
137 pass
139 def b(self, a, b, c):
140 pass
142 def c(self, a, b, c=1):
143 pass
145 def d(self, a, b, *, c = 88):
146 pass
148 def e(self, a, b, c = 88, **kwds):
149 pass
151 def f(self, a, b, *, c, d = 42):
152 pass
154 def g(self, a, b, *, c, d = 42, e = 17, f, **kwds):
155 pass
157 def h(self, a, b, *args, c, d = 42, e = 17, f, **kwds):
158 pass
160 def k(self, a, b, c=1, *args, d = 42, e = 17, f, **kwds):
161 pass
163 def l(self, a, b, c=1, *args, d = 42, e = 17, f, **kwds):
164 """Existing string"""
165 pass
167 cpdef int get_int(self):
168 return 0
170 cpdef float get_float(self):
171 return 0.0
173 cpdef str get_str(self):
174 """Existing string"""
175 return "string"
177 cpdef Ext clone(self):
178 return Ext(1,2)
180 def foo():
181 pass
183 def types(Ext a, int b, unsigned short c, float d, e):
184 pass
186 def with_doc_1(a, b, c):
187 """Existing string"""
188 pass
190 def with_doc_2(a, b, c):
191 """
192 Existing string
193 """
194 pass
196 cpdef with_doc_3(a, b, c):
197 """Existing string"""
198 pass
200 cpdef str with_doc_4(int a, str b, list c):
201 """
202 Existing string
203 """
204 return b
206 cpdef char f_c(char c):
207 return c
209 cpdef unsigned char f_uc(unsigned char c):
210 return c
212 cpdef signed char f_sc(signed char c):
213 return c
216 cpdef short f_s(short s):
217 return s
219 cpdef unsigned short f_us(unsigned short s):
220 return s
222 cpdef signed short f_ss(signed short s):
223 return s
226 cpdef int f_i(int i):
227 return i
229 cpdef unsigned int f_ui(unsigned int i):
230 return i
232 cpdef signed int f_si(signed int i):
233 return i
236 cpdef long f_l(long l):
237 return l
239 cpdef unsigned long f_ul(unsigned long l):
240 return l
242 cpdef signed long f_sl(signed long l):
243 return l
246 cpdef long long f_L(long long L):
247 return L
249 cpdef unsigned long long f_uL(unsigned long long L):
250 return L
252 cpdef signed long long f_sL(signed long long L):
253 return L
256 cpdef float f_f(float f):
257 return f
259 cpdef double f_d(double d):
260 return d
262 cpdef long double f_D(long double D):
263 return D