Closed
Description
Feature or enhancement
Proposal:
More discussion: #132504 (comment)
This is the current message which is not very clear (it comes from ctypes.sizeof
):
>>> from multiprocessing import Array
>>> Array('x', 1)
...
TypeError: this type has no size
I propose we change it to:
>>> from multiprocessing import Array
>>> Array('x', 1)
TypeError: bad typecode (must be a ctypes type or one of c, b, B, u, h, H, i, I, l, L, q, Q, f or d)
This is modeled after the error message in array.array
which is more informative:
>>> array('x')
...
ValueError: bad typecode (must be b, B, u, w, h, H, i, I, l, L, q, Q, f or d)
(A ValueError
seems like a more appropriate option for multiprocessing as well, but that'd be a breaking change)
Note that, multiprocessing.Array
(and Value
) does not support the 'w' typecode while array.array
does.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere