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
4e6e9f4d
Commit
4e6e9f4d
authored
Oct 12, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CythonUtilityCode equality to avoid duplication.
parent
6224744e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-0
Cython/Compiler/UtilityCode.py
Cython/Compiler/UtilityCode.py
+12
-0
tests/run/cfunc_convert.pyx
tests/run/cfunc_convert.pyx
+7
-0
No files found.
Cython/Compiler/Nodes.py
View file @
4e6e9f4d
...
@@ -1302,6 +1302,7 @@ class CVarDefNode(StatNode):
...
@@ -1302,6 +1302,7 @@ class CVarDefNode(StatNode):
if
'staticmethod'
in
env
.
directives
:
if
'staticmethod'
in
env
.
directives
:
type
.
is_static_method
=
True
type
.
is_static_method
=
True
if
create_extern_wrapper
:
if
create_extern_wrapper
:
self
.
entry
.
type
.
create_to_py_utility_code
(
env
)
self
.
entry
.
create_wrapper
=
True
self
.
entry
.
create_wrapper
=
True
else
:
else
:
if
self
.
directive_locals
:
if
self
.
directive_locals
:
...
...
Cython/Compiler/UtilityCode.py
View file @
4e6e9f4d
...
@@ -87,6 +87,18 @@ class CythonUtilityCode(Code.UtilityCodeBase):
...
@@ -87,6 +87,18 @@ class CythonUtilityCode(Code.UtilityCodeBase):
self
.
outer_module_scope
=
outer_module_scope
self
.
outer_module_scope
=
outer_module_scope
self
.
compiler_directives
=
compiler_directives
self
.
compiler_directives
=
compiler_directives
def
__eq__
(
self
,
other
):
if
isinstance
(
other
,
CythonUtilityCode
):
return
self
.
_equality_params
()
==
other
.
_equality_params
()
else
:
return
False
def
_equality_params
(
self
):
return
self
.
impl
,
self
.
outer_module_scope
,
self
.
compiler_directives
def
__hash__
(
self
):
return
hash
(
self
.
impl
)
def
get_tree
(
self
,
entries_only
=
False
,
cython_scope
=
None
):
def
get_tree
(
self
,
entries_only
=
False
,
cython_scope
=
None
):
from
.AnalysedTreeTransforms
import
AutoTestDictTransform
from
.AnalysedTreeTransforms
import
AutoTestDictTransform
# The AutoTestDictTransform creates the statement "__test__ = {}",
# The AutoTestDictTransform creates the statement "__test__ = {}",
...
...
tests/run/cfunc_convert.pyx
View file @
4e6e9f4d
...
@@ -8,13 +8,20 @@ from libc.math cimport sqrt
...
@@ -8,13 +8,20 @@ from libc.math cimport sqrt
cdef
void
empty_cfunc
():
cdef
void
empty_cfunc
():
print
"here"
print
"here"
# same signature
cdef
void
another_empty_cfunc
():
print
"there"
def
call_empty_cfunc
():
def
call_empty_cfunc
():
"""
"""
>>> call_empty_cfunc()
>>> call_empty_cfunc()
here
here
there
"""
"""
cdef
object
py_func
=
empty_cfunc
cdef
object
py_func
=
empty_cfunc
py_func
()
py_func
()
cdef
object
another_py_func
=
another_empty_cfunc
another_py_func
()
cdef
double
square_c
(
double
x
):
cdef
double
square_c
(
double
x
):
...
...
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