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
3cf53d8b
Commit
3cf53d8b
authored
Jul 13, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make operator [] work for cypclasses
parent
45ce500e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+8
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
3cf53d8b
...
...
@@ -4223,7 +4223,10 @@ class IndexNode(_IndexingBaseNode):
if
(
self
.
type
.
is_ptr
or
self
.
type
.
is_array
)
and
self
.
type
==
self
.
base
.
type
:
error
(
self
.
pos
,
"Invalid use of pointer slice"
)
return
index_code
=
"(%s[%s])"
if
self
.
base
.
type
.
is_cyp_class
:
index_code
=
"((*%s)[%s])"
else
:
index_code
=
"(%s[%s])"
return
index_code
%
(
self
.
base
.
result
(),
self
.
index
.
result
())
def
extra_index_params
(
self
,
code
):
...
...
@@ -4296,8 +4299,11 @@ class IndexNode(_IndexingBaseNode):
index_code
=
self
.
index
.
py_result
()
if
self
.
base
.
type
.
is_cpp_class
and
self
.
exception_check
:
base_result
=
self
.
base
.
result
()
if
self
.
base
.
type
.
is_cyp_class
:
base_result
=
"(*%s)"
%
base_result
translate_cpp_exception
(
code
,
self
.
pos
,
"%s = %s[%s];"
%
(
self
.
result
(),
self
.
base
.
result
()
,
"%s = %s[%s];"
%
(
self
.
result
(),
base_result
,
self
.
index
.
result
()),
self
.
result
()
if
self
.
type
.
is_pyobject
else
None
,
self
.
exception_value
,
self
.
in_nogil_context
)
...
...
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