Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
6f637eff
Commit
6f637eff
authored
Apr 29, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended closure test case, more bug analysis
parent
30a0e717
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
tests/run/closures_T82.pyx
tests/run/closures_T82.pyx
+23
-7
No files found.
tests/run/closures_T82.pyx
View file @
6f637eff
...
...
@@ -6,6 +6,10 @@ __doc__ = u"""
>>> a(5)()
8
>>> local_x(1)(2)(4)
4 2 1
15
# this currently segfaults:
#>>> x(1)(2)(4)
#15
...
...
@@ -36,6 +40,7 @@ __doc__ = u"""
#True
>>> inner_funcs = more_inner_funcs(1)(2,4,8)
# this currently segfaults:
#>>> inner_funcs[0](16), inner_funcs[1](32), inner_funcs[2](64)
...
...
@@ -53,15 +58,26 @@ def a(int x):
return
c
()
return
b
def
x
(
int
x
):
# currently segfaults
def
y
(
y
):
def
z
(
long
z
):
return
8
+
z
+
y
+
x
def
local_x
(
int
arg_x
):
cdef
int
local_x
=
arg_x
def
y
(
arg_y
):
y
=
arg_y
def
z
(
long
arg_z
):
cdef
long
z
=
arg_z
print
z
,
y
,
local_x
return
8
+
z
+
y
+
local_x
return
z
return
y
# currently crashes Cython due to name redefinitions (see local_x())
## def x(int x):
## # currently segfaults
## def y(y):
## def z(long z):
## return 8+z+y+x
## return z
## return y
def
inner_override
(
a
,
b
):
def
f
():
...
...
@@ -90,7 +106,7 @@ def reassign_int_int(int x):
def
cy_twofuncs
(
x
):
#
pretty ugly segfault in PyEval_EvalFrameEx() *after* calling cy_twofuncs() !
#
currently segfaults: adding NULL pointers
def
f
(
a
):
return
g
(
x
)
+
a
def
g
(
b
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment