Terry J. Reedy <tjre...@udel.edu> added the comment:
https://docs.python.org/3/library/stdtypes.html#typememoryview says "itemsize The size in bytes of each element of the memoryview" Revising the code example to use an empty array: >>> import array, struct >>> m = memoryview(array.array('H', [0]) >>> m.itemsize 2 I agree that itemsize should also be non-zero for ctype formats. ---------- title: memoryview & ctypes: incorrect PEP3118 itemsize for empty array -> memoryview & ctypes: incorrect itemsize for empty array _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32782> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com