You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve the error message for invalid typecodes in multiprocessing.{Array,Value} #133017
This is the current message which is not very clear (it comes from ctypes.sizeof):
>>>frommultiprocessingimportArray>>>Array('x', 1)
...
TypeError: this type hasnosize
I propose we change it to:
>>>frommultiprocessingimportArray>>>Array('x', 1)
TypeError: badtypecode (mustbeactypestypeoroneofc, b, B, u, h, H, i, I, l, L, q, Q, ford)
This is modeled after the error message in array.array which is more informative:
>>>array('x')
...
ValueError: badtypecode (mustbeb, B, u, w, h, H, i, I, l, L, q, Q, ford)
(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
Activity
gh-133017: Improve error message for invalid typecodes in multiproces…
pythongh-133017: Improve error message for invalid typecodes in multi…
pythongh-133017: Improve error message for invalid typecodes in multi…