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
0917c169
Commit
0917c169
authored
May 25, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow conversion to PyObject only when supported (e.g. not for templated cypclasses)
parent
e2775a7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+8
-1
No files found.
Cython/Compiler/Nodes.py
View file @
0917c169
...
@@ -1637,7 +1637,8 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode):
...
@@ -1637,7 +1637,8 @@ class CppClassNode(CStructOrUnionDefNode, BlockNode):
cclass_bases
=
TupleNode
(
self
.
pos
,
args
=
[])
cclass_bases
=
TupleNode
(
self
.
pos
,
args
=
[])
if
self
.
templates
:
if
self
.
templates
:
print
(
"Quick warning: Python wrappers for templated cypclasses are not supported yet"
)
# Python wrapper for templated cypclasses not supported yet
# this is signaled to the compiler by not doing what is below
return
return
if
self
.
attributes
is
not
None
:
if
self
.
attributes
is
not
None
:
...
...
Cython/Compiler/PyrexTypes.py
View file @
0917c169
...
@@ -3963,7 +3963,7 @@ class CypClassType(CppClassType):
...
@@ -3963,7 +3963,7 @@ class CypClassType(CppClassType):
# wrapper_type PyExtensionType or None the type of the cclass wrapper
# wrapper_type PyExtensionType or None the type of the cclass wrapper
is_cyp_class
=
1
is_cyp_class
=
1
to_py_function
=
"__Pyx_PyObject_FromCyObject"
to_py_function
=
None
def
__init__
(
self
,
name
,
scope
,
cname
,
base_classes
,
templates
=
None
,
template_type
=
None
,
nogil
=
0
,
lock_mode
=
None
,
activable
=
False
):
def
__init__
(
self
,
name
,
scope
,
cname
,
base_classes
,
templates
=
None
,
template_type
=
None
,
nogil
=
0
,
lock_mode
=
None
,
activable
=
False
):
CppClassType
.
__init__
(
self
,
name
,
scope
,
cname
,
base_classes
,
templates
,
template_type
,
nogil
)
CppClassType
.
__init__
(
self
,
name
,
scope
,
cname
,
base_classes
,
templates
,
template_type
,
nogil
)
...
@@ -4026,6 +4026,13 @@ class CypClassType(CppClassType):
...
@@ -4026,6 +4026,13 @@ class CypClassType(CppClassType):
self
.
_left_path_to_base
[
base
]
=
path
self
.
_left_path_to_base
[
base
]
=
path
return
path
return
path
# allow conversion to Python only when wrapping is supported
def
create_to_py_utility_code
(
self
,
env
):
if
not
self
.
wrapper_type
:
return
False
self
.
to_py_function
=
"__Pyx_PyObject_FromCyObject"
return
True
def
empty_declaration_code
(
self
):
def
empty_declaration_code
(
self
):
if
self
.
_empty_declaration
is
None
:
if
self
.
_empty_declaration
is
None
:
self
.
_empty_declaration
=
self
.
declaration_code
(
''
,
deref
=
1
)
self
.
_empty_declaration
=
self
.
declaration_code
(
''
,
deref
=
1
)
...
...
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