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
01529c0c
Commit
01529c0c
authored
Sep 15, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow arrays of C++ classes.
parent
b4aff54d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
CHANGES.rst
CHANGES.rst
+2
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-1
No files found.
CHANGES.rst
View file @
01529c0c
...
...
@@ -12,6 +12,8 @@ Bugs fixed
if the already created module was used later on (e.g. through a
stale reference in sys.modules or elsewhere).
* Allow arrays of C++ classes.
0.21 (2014-09-10)
=================
...
...
Cython/Compiler/Nodes.py
View file @
01529c0c
...
...
@@ -531,7 +531,7 @@ class CArrayDeclaratorNode(CDeclaratorNode):
child_attrs
=
[
"base"
,
"dimension"
]
def
analyse
(
self
,
base_type
,
env
,
nonempty
=
0
):
if
base_type
.
is_cpp_class
or
base_type
.
is_cfunction
:
if
(
base_type
.
is_cpp_class
and
base_type
.
is_template_type
())
or
base_type
.
is_cfunction
:
from
.ExprNodes
import
TupleNode
if
isinstance
(
self
.
dimension
,
TupleNode
):
args
=
self
.
dimension
.
args
...
...
@@ -1090,7 +1090,7 @@ class TemplatedTypeNode(CBaseTypeNode):
base_type
=
self
.
base_type_node
.
analyse
(
env
)
if
base_type
.
is_error
:
return
base_type
if
base_type
.
is_cpp_class
:
if
base_type
.
is_cpp_class
and
base_type
.
is_template_type
()
:
# Templated class
if
self
.
keyword_args
and
self
.
keyword_args
.
key_value_pairs
:
error
(
self
.
pos
,
"c++ templates cannot take keyword arguments"
)
...
...
Cython/Compiler/PyrexTypes.py
View file @
01529c0c
...
...
@@ -3106,8 +3106,11 @@ class CppClassType(CType):
self
.
to_py_function
=
cname
return
True
def
is_template_type
(
self
):
return
self
.
templates
is
not
None
and
self
.
template_type
is
None
def
specialize_here
(
self
,
pos
,
template_values
=
None
):
if
self
.
templates
is
None
:
if
not
self
.
is_template_type
()
:
error
(
pos
,
"'%s' type is not a template"
%
self
)
return
error_type
if
len
(
self
.
templates
)
!=
len
(
template_values
):
...
...
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