Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
1098d1d6
Commit
1098d1d6
authored
Dec 13, 2019
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/basics/memoryview_itemsize: Make portable to 32- and 64-bit archs.
parent
33b0a7e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
tests/basics/memoryview_itemsize.py
tests/basics/memoryview_itemsize.py
+4
-1
No files found.
tests/basics/memoryview_itemsize.py
View file @
1098d1d6
...
...
@@ -12,9 +12,12 @@ except ImportError:
print
(
"SKIP"
)
raise
SystemExit
for
code
in
[
'b'
,
'h'
,
'i'
,
'
l'
,
'
q'
,
'f'
,
'd'
]:
for
code
in
[
'b'
,
'h'
,
'i'
,
'q'
,
'f'
,
'd'
]:
print
(
memoryview
(
array
(
code
)).
itemsize
)
# 'l' varies depending on word size of the machine
print
(
memoryview
(
array
(
'l'
)).
itemsize
in
(
4
,
8
))
# shouldn't be able to store to the itemsize attribute
try
:
memoryview
(
b'a'
).
itemsize
=
1
...
...
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