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
Gwenaël Samain
cython
Commits
2e8e56c8
Commit
2e8e56c8
authored
Apr 14, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Don't assume a NameNode attribute base in NumpySupport"
This reverts commit
29d68530
.
parent
ff7a7984
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
Cython/Compiler/NumpySupport.py
Cython/Compiler/NumpySupport.py
+1
-1
tests/run/numpy_attributes.pyx
tests/run/numpy_attributes.pyx
+3
-12
No files found.
Cython/Compiler/NumpySupport.py
View file @
2e8e56c8
...
...
@@ -26,7 +26,7 @@ def numpy_transform_attribute_node(node):
return
node
pos
=
node
.
pos
numpy_pxd_scope
=
node
.
obj
.
type
.
scope
.
parent_scope
numpy_pxd_scope
=
node
.
obj
.
entry
.
type
.
scope
.
parent_scope
def
macro_call_node
(
numpy_macro_name
):
array_node
=
node
.
obj
...
...
tests/run/numpy_attributes.pyx
View file @
2e8e56c8
...
...
@@ -4,7 +4,6 @@
import
numpy
as
np
cimport
numpy
as
np
int64_array
=
np
.
ones
((
3
,
2
),
dtype
=
np
.
int64
)
def
f
():
"""
...
...
@@ -15,7 +14,7 @@ def f():
shape[1] 2
strides 16 8
"""
cdef
np
.
ndarray
x
=
int64_array
cdef
np
.
ndarray
x
=
np
.
ones
((
3
,
2
),
dtype
=
np
.
int64
)
cdef
int
i
cdef
Py_ssize_t
j
,
k
cdef
char
*
p
...
...
@@ -44,11 +43,3 @@ def f():
k
=
x
.
strides
[
1
]
print
'strides'
,
j
,
k
def
test_non_namenode_attribute_access
(
obj
):
"""
>>> test_non_namenode_attribute_access(int64_array)
data 1
"""
# Try casting, resulting in an AttributeNode with a TypeCastNode as object
# and 'data' as attribute
print
"data"
,
(
<
np
.
int64_t
*>
(
<
np
.
ndarray
>
obj
).
data
)[
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