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
e8c8482f
Commit
e8c8482f
authored
Feb 01, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cleanup of merged pull request, add test
parent
78776053
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
Cython/Utility/MemoryView.pyx
Cython/Utility/MemoryView.pyx
+4
-2
tests/memoryview/memoryview.pyx
tests/memoryview/memoryview.pyx
+10
-0
No files found.
Cython/Utility/MemoryView.pyx
View file @
e8c8482f
...
...
@@ -986,9 +986,11 @@ cdef memoryview_fromslice({{memviewslice_name}} memviewslice,
result
.
view
.
shape
=
<
Py_ssize_t
*>
result
.
from_slice
.
shape
result
.
view
.
strides
=
<
Py_ssize_t
*>
result
.
from_slice
.
strides
# only set suboffsets if actually used, otherwise set to NULL to improve compatibility
result
.
view
.
suboffsets
=
NULL
for
i
in
range
(
ndim
)
:
if
result
.
from_slice
.
suboffsets
[
i
]
>=
0
:
for
suboffset
in
result
.
from_slice
.
suboffsets
[:
ndim
]
:
if
suboffset
>=
0
:
result
.
view
.
suboffsets
=
<
Py_ssize_t
*>
result
.
from_slice
.
suboffsets
break
...
...
tests/memoryview/memoryview.pyx
View file @
e8c8482f
...
...
@@ -1012,3 +1012,13 @@ def test_assignment_in_conditional_expression(bint left):
c
=
a
if
left
else
b
for
i
in
range
(
c
.
shape
[
0
]):
print
c
[
i
]
def
test_cpython_offbyone_issue_23349
():
"""
>>> print(test_cpython_offbyone_issue_23349())
testing
"""
cdef
unsigned
char
[:]
v
=
bytearray
(
b"testing"
)
# the following returns 'estingt' without the workaround
return
bytearray
(
v
).
decode
(
'ascii'
)
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