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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
7df9d654
Commit
7df9d654
authored
Jun 24, 2015
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support cpdef void methods.
parent
6c201262
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
CHANGES.rst
CHANGES.rst
+2
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+6
-1
tests/run/cpdef.pyx
tests/run/cpdef.pyx
+24
-0
No files found.
CHANGES.rst
View file @
7df9d654
...
@@ -80,6 +80,8 @@ Bugs fixed
...
@@ -80,6 +80,8 @@ Bugs fixed
* C++ exception declarations with mapping functions could fail to compile when
* C++ exception declarations with mapping functions could fail to compile when
pre-declared in .pxd files.
pre-declared in .pxd files.
* ``cpdef void`` methods are now permitted.
Other changes
Other changes
-------------
-------------
...
...
Cython/Compiler/Nodes.py
View file @
7df9d654
...
@@ -4141,6 +4141,11 @@ class OverrideCheckNode(StatNode):
...
@@ -4141,6 +4141,11 @@ class OverrideCheckNode(StatNode):
self
.
pos
,
function
=
self
.
func_node
,
self
.
pos
,
function
=
self
.
func_node
,
args
=
[
ExprNodes
.
NameNode
(
self
.
pos
,
name
=
arg
.
name
)
args
=
[
ExprNodes
.
NameNode
(
self
.
pos
,
name
=
arg
.
name
)
for
arg
in
self
.
args
[
first_arg
:]
])
for
arg
in
self
.
args
[
first_arg
:]
])
if
env
.
return_type
.
is_void
or
env
.
return_type
.
is_returncode
:
self
.
body
=
StatListNode
(
self
.
pos
,
stats
=
[
ExprStatNode
(
self
.
pos
,
expr
=
call_node
),
ReturnStatNode
(
self
.
pos
,
value
=
None
)])
else
:
self
.
body
=
ReturnStatNode
(
self
.
pos
,
value
=
call_node
)
self
.
body
=
ReturnStatNode
(
self
.
pos
,
value
=
call_node
)
self
.
body
=
self
.
body
.
analyse_expressions
(
env
)
self
.
body
=
self
.
body
.
analyse_expressions
(
env
)
return
self
return
self
...
...
tests/run/cpdef.pyx
View file @
7df9d654
...
@@ -15,3 +15,27 @@ cpdef void raisable() except *:
...
@@ -15,3 +15,27 @@ cpdef void raisable() except *:
"""
"""
print
(
'here'
)
print
(
'here'
)
raise
RuntimeError
()
raise
RuntimeError
()
cdef
class
A
:
"""
>>> A().foo()
A
"""
cpdef
void
foo
(
self
):
print
"A"
cdef
class
B
(
A
):
"""
>>> B().foo()
B
"""
cpdef
void
foo
(
self
):
print
"B"
class
C
(
B
):
"""
>>> C().foo()
C
"""
def
foo
(
self
):
print
"C"
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