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
21678da9
Commit
21678da9
authored
Jul 05, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Template class coercion fixes.
parent
90dcd5ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+15
-2
No files found.
Cython/Compiler/PyrexTypes.py
View file @
21678da9
...
...
@@ -3425,7 +3425,13 @@ class CppClassType(CType):
return
''
def
can_coerce_from_pyobject
(
self
,
env
):
return
self
.
cname
in
builtin_cpp_conversions
or
self
.
cname
in
cpp_string_conversions
if
self
.
cname
in
builtin_cpp_conversions
or
self
.
cname
in
cpp_string_conversions
:
for
ix
,
T
in
enumerate
(
self
.
templates
or
[]):
if
ix
>=
builtin_cpp_conversions
[
self
.
cname
]:
break
if
T
.
is_pyobject
or
not
T
.
can_coerce_from_pyobject
(
env
):
return
False
return
True
def
create_from_py_utility_code
(
self
,
env
):
if
self
.
from_py_function
is
not
None
:
...
...
@@ -3460,7 +3466,14 @@ class CppClassType(CType):
return
True
def
can_coerce_to_pyobject
(
self
,
env
):
return
self
.
cname
in
builtin_cpp_conversions
or
self
.
cname
in
cpp_string_conversions
if
self
.
cname
in
builtin_cpp_conversions
or
self
.
cname
in
cpp_string_conversions
:
for
ix
,
T
in
enumerate
(
self
.
templates
or
[]):
if
ix
>=
builtin_cpp_conversions
[
self
.
cname
]:
break
if
T
.
is_pyobject
or
not
T
.
can_coerce_to_pyobject
(
env
):
return
False
return
True
def
create_to_py_utility_code
(
self
,
env
):
if
self
.
to_py_function
is
not
None
:
...
...
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