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
00b26e0b
Commit
00b26e0b
authored
Jun 23, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap cypclass methods only when all args can be converted *from* python
parent
b7135b9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
Cython/Compiler/CypclassWrapper.py
Cython/Compiler/CypclassWrapper.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-0
No files found.
Cython/Compiler/CypclassWrapper.py
View file @
00b26e0b
...
@@ -378,7 +378,7 @@ class CypclassWrapperInjection(Visitor.CythonTransform):
...
@@ -378,7 +378,7 @@ class CypclassWrapperInjection(Visitor.CythonTransform):
return
# skip c methods with Python-incompatible return types
return
# skip c methods with Python-incompatible return types
for
argtype
in
cfunc_type
.
args
:
for
argtype
in
cfunc_type
.
args
:
if
not
argtype
.
type
.
can_coerce_
to
_pyobject
(
self
.
module_scope
):
if
not
argtype
.
type
.
can_coerce_
from
_pyobject
(
self
.
module_scope
):
return
# skip c methods with Python-incompatible argument types
return
# skip c methods with Python-incompatible argument types
# > name of the wrapping method: same name as in the original code
# > name of the wrapping method: same name as in the original code
...
...
Cython/Compiler/PyrexTypes.py
View file @
00b26e0b
...
@@ -4241,6 +4241,10 @@ class CypClassType(CppClassType):
...
@@ -4241,6 +4241,10 @@ class CypClassType(CppClassType):
def
can_coerce_to_pyobject
(
self
,
env
):
def
can_coerce_to_pyobject
(
self
,
env
):
return
self
.
wrapper_type
is
not
None
return
self
.
wrapper_type
is
not
None
# allow conversion from Python only when there is a wrapper type
def
can_coerce_from_pyobject
(
self
,
env
):
return
self
.
wrapper_type
is
not
None
def
create_to_py_utility_code
(
self
,
env
):
def
create_to_py_utility_code
(
self
,
env
):
if
not
self
.
wrapper_type
:
if
not
self
.
wrapper_type
:
return
False
return
False
...
...
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