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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
5ddddeed
Commit
5ddddeed
authored
Apr 28, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple fix for #155
parent
31c250b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-2
Cython/Compiler/Visitor.py
Cython/Compiler/Visitor.py
+1
-0
tests/run/numpy_bufacc_T155.pyx
tests/run/numpy_bufacc_T155.pyx
+15
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
5ddddeed
...
@@ -1705,8 +1705,6 @@ class IndexNode(ExprNode):
...
@@ -1705,8 +1705,6 @@ class IndexNode(ExprNode):
if
self
.
indices
:
if
self
.
indices
:
indices
=
self
.
indices
indices
=
self
.
indices
else
:
else
:
# On cloning, indices is cloned. Otherwise, unpack index into indices
assert
not
isinstance
(
self
.
index
,
CloneNode
)
if
isinstance
(
self
.
index
,
TupleNode
):
if
isinstance
(
self
.
index
,
TupleNode
):
indices
=
self
.
index
.
args
indices
=
self
.
index
.
args
else
:
else
:
...
@@ -1719,6 +1717,9 @@ class IndexNode(ExprNode):
...
@@ -1719,6 +1717,9 @@ class IndexNode(ExprNode):
if
not
x
.
type
.
is_int
:
if
not
x
.
type
.
is_int
:
buffer_access
=
False
buffer_access
=
False
# On cloning, indices is cloned. Otherwise, unpack index into indices
assert
not
(
buffer_access
and
isinstance
(
self
.
index
,
CloneNode
))
if
buffer_access
:
if
buffer_access
:
self
.
indices
=
indices
self
.
indices
=
indices
self
.
index
=
None
self
.
index
=
None
...
...
Cython/Compiler/Visitor.py
View file @
5ddddeed
...
@@ -150,6 +150,7 @@ class TreeVisitor(BasicVisitor):
...
@@ -150,6 +150,7 @@ class TreeVisitor(BasicVisitor):
except
Errors
.
CompileError
:
except
Errors
.
CompileError
:
raise
raise
except
Exception
,
e
:
except
Exception
,
e
:
raise
import
sys
import
sys
trace
=
[
''
]
trace
=
[
''
]
for
parent
,
attribute
,
index
in
self
.
access_path
:
for
parent
,
attribute
,
index
in
self
.
access_path
:
...
...
tests/run/numpy_bufacc_T155.pyx
0 → 100644
View file @
5ddddeed
"""
>>> myfunc()
0.5
"""
cimport
numpy
as
np
import
numpy
as
np
def
myfunc
():
cdef
np
.
ndarray
[
float
,
ndim
=
2
]
A
=
np
.
ones
((
1
,
1
),
dtype
=
np
.
float32
)
cdef
int
i
for
i
from
0
<=
i
<
A
.
shape
[
0
]:
A
[
i
,
:]
/=
2
return
A
[
0
,
0
]
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