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
Kirill Smelkov
cython
Commits
926337d9
Commit
926337d9
authored
Jul 19, 2013
by
Gerald Dalley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak to PyDataType_SHAPE: return () instead of None
This makes PyDataType_SHAPE more consistent with the Python API.
parent
7bd68089
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Cython/Includes/numpy.pxd
Cython/Includes/numpy.pxd
+1
-1
tests/run/numpy_subarray.pyx
tests/run/numpy_subarray.pyx
+2
-2
No files found.
Cython/Includes/numpy.pxd
View file @
926337d9
...
...
@@ -803,7 +803,7 @@ cdef inline tuple PyDataType_SHAPE(dtype d):
if
PyDataType_HASSUBARRAY
(
d
):
return
<
tuple
>
d
.
subarray
.
shape
else
:
return
None
return
()
cdef
inline
char
*
_util_dtypestring
(
dtype
descr
,
char
*
f
,
char
*
end
,
int
*
offset
)
except
NULL
:
# Recursive utility function used in __getbuffer__ to get format
...
...
tests/run/numpy_subarray.pyx
View file @
926337d9
...
...
@@ -32,6 +32,6 @@ def test_record_subarray():
assert
<
tuple
>
b_descr
.
subarray
.
shape
==
(
3
,
3
)
# Make sure the safe high-level helper function works
assert
np
.
PyDataType_SHAPE
(
descr
)
is
None
assert
np
.
PyDataType_SHAPE
(
a_descr
)
is
None
assert
np
.
PyDataType_SHAPE
(
descr
)
==
()
assert
np
.
PyDataType_SHAPE
(
a_descr
)
==
()
assert
np
.
PyDataType_SHAPE
(
b_descr
)
==
(
3
,
3
)
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