projects
/
cython.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Remove trailing whitespace.
[cython.git]
/
tests
/
run
/
bad_c_struct_T252.pyx
1
cdef cf(default=None):
2
return default
3
4
cpdef cpf(default=100):
5
"""
6
>>> cpf()
7
100
8
>>> cpf(1)
9
1
10
>>> cpf(default=2)
11
2
12
"""
13
default = cf(default)
14
return default
15
16
def pf(default=100):
17
"""
18
>>> pf()
19
100
20
>>> pf(1)
21
1
22
>>> pf(default=2)
23
2
24
"""
25
return default
26
27
28
cdef struct foo:
29
int void
30
int default
31
32
def test_struct():
33
"""
34
>>> test_struct()
35
(1, 2)
36
"""
37
cdef foo foo_struct
38
foo_struct.void = 1
39
foo_struct.default = 2
40
return foo_struct.void, foo_struct.default
41
42
43
cdef class Foo:
44
cdef int void
45
cdef int default
46
47
def test_class():
48
"""
49
>>> test_class()
50
(1, 2)
51
"""
52
cdef Foo foo_instance = Foo()
53
foo_instance.void = 1
54
foo_instance.default = 2
55
return foo_instance.void, foo_instance.default