summaryrefslogtreecommitdiff
path: root/tests/basics/memoryview_itemsize.py
blob: 60cb823087c45fcd1cc84d94e6c666d5d1a9d753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
try:
    memoryview(b'a').itemsize
    from array import array
except:
    print("SKIP")
    raise SystemExit

for code in ['b', 'h', 'i', 'l', 'q', 'f', 'd']:
    print(memoryview(array(code)).itemsize)

# shouldn't be able to store to the itemsize attribute
try:
    memoryview(b'a').itemsize = 1
except AttributeError:
    print('AttributeError')