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
41d0069f
Commit
41d0069f
authored
Jul 13, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make operator [] work for cypclasses
parent
903f11a5
Changes
1
Show 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 @
41d0069f
...
...
@@ -4172,6 +4172,9 @@ 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
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
())
...
...
@@ -4245,8 +4248,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