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
1e46ef9e
Commit
1e46ef9e
authored
Sep 04, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.23.x'
parents
36292c55
84191a20
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
CHANGES.rst
CHANGES.rst
+2
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-2
tests/run/static_methods.pxd
tests/run/static_methods.pxd
+3
-0
tests/run/static_methods.pyx
tests/run/static_methods.pyx
+13
-0
No files found.
CHANGES.rst
View file @
1e46ef9e
...
...
@@ -55,6 +55,8 @@ Bugs fixed
* ``ino_t`` in ``posix.types`` was not declared as ``unsigned``.
* Static cdef methods can now be declared in .pxd files.
0.23.1 (2015-08-22)
===================
...
...
Cython/Compiler/Nodes.py
View file @
1e46ef9e
...
...
@@ -1327,13 +1327,13 @@ class CVarDefNode(StatNode):
error
(
declarator
.
pos
,
"Missing name in declaration."
)
return
if
type
.
is_cfunction
:
if
'staticmethod'
in
env
.
directives
:
type
.
is_static_method
=
True
self
.
entry
=
dest_scope
.
declare_cfunction
(
name
,
type
,
declarator
.
pos
,
cname
=
cname
,
visibility
=
self
.
visibility
,
in_pxd
=
self
.
in_pxd
,
api
=
self
.
api
,
modifiers
=
self
.
modifiers
,
overridable
=
self
.
overridable
)
if
self
.
entry
is
not
None
:
self
.
entry
.
directive_locals
=
copy
.
copy
(
self
.
directive_locals
)
if
'staticmethod'
in
env
.
directives
:
type
.
is_static_method
=
True
if
create_extern_wrapper
:
self
.
entry
.
type
.
create_to_py_utility_code
(
env
)
self
.
entry
.
create_wrapper
=
True
...
...
tests/run/static_methods.pxd
0 → 100644
View file @
1e46ef9e
cdef
class
FromPxd
:
@
staticmethod
cdef
static_cdef
(
int
*
x
)
tests/run/static_methods.pyx
View file @
1e46ef9e
...
...
@@ -50,3 +50,16 @@ def call_static_cdef(int x):
# ('cpdef', 2)
# """
# return A.static_cpdef(x)
cdef
class
FromPxd
:
@
staticmethod
cdef
static_cdef
(
int
*
x
):
return
'pxd_cdef'
,
x
[
0
]
def
call_static_pxd_cdef
(
int
x
):
"""
>>> call_static_pxd_cdef(2)
('pxd_cdef', 2)
"""
cdef
int
*
x_ptr
=
&
x
return
FromPxd
.
static_cdef
(
x_ptr
)
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