You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
584 B

try:
memoryview(b'a').itemsize
except:
print("SKIP")
raise SystemExit
try:
from uarray import array
except ImportError:
try:
from array import array
except ImportError:
print("SKIP")
raise SystemExit
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
except AttributeError:
print('AttributeError')