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
3060b7f1
Commit
3060b7f1
authored
Mar 30, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extended test case, includes attribute access testing
parent
9fbcb329
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
tests/run/closure_self.pyx
tests/run/closure_self.pyx
+32
-5
No files found.
tests/run/closure_self.pyx
View file @
3060b7f1
cdef
class
Test
:
cdef
int
x
cdef
class
SelfInClosure
(
object
):
cdef
class
SelfInClosure
(
object
):
cdef
Test
_t
cdef
int
x
def
plain
(
self
):
"""
"""
>>> o = SelfInClosure()
>>> o = SelfInClosure()
>>> o.closure_method()() == o
>>> o.plain()
True
1
"""
"""
self
.
x
=
1
return
self
.
x
def
closure_method
(
self
):
def
closure_method
(
self
):
"""
>>> o = SelfInClosure()
>>> o.closure_method()() == o
True
"""
def
nested
():
def
nested
():
return
self
return
self
return
nested
return
nested
def
closure_method_cdef_attr
(
self
,
Test
t
):
"""
>>> o = SelfInClosure()
>>> o.closure_method_cdef_attr(Test())()
(1, 2)
"""
t
.
x
=
2
self
.
_t
=
t
self
.
x
=
1
def
nested
():
return
self
.
x
,
t
.
x
return
nested
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