gh-76187: Document the c typecode for multiprocessing.Array.#132504
gh-76187: Document the c typecode for multiprocessing.Array.#132504tomasr8 merged 4 commits intopython:mainfrom
c typecode for multiprocessing.Array.#132504Conversation
gpshead
left a comment
There was a problem hiding this comment.
Could you also mention that the w typecode of array is not supported? (glancing at the code, it is missing from Lib/multiprocessing/sharedctypes.py)
Will do. Do you think it's worth to improve the error message for invalid typecodes as well? >>> array('x')
...
ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)(And I just noticed that the error message doesn't include 'w' 😆 ) |
|
Yeah, improving the error message and/or even adding 'w' support are all also viable options. I expect this part of the code was inherited from the original upstream project multiprocessing came from and likely hasn't been meaningfully touched since? It's a dark corner. |
|
Updated to mention that
I'll send a patch to improve the error message and align it with that of |
|
I'm planning to merge this docs fix, we can think about supporting 'w' in a separate issue :) |
|
Thanks @tomasr8 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
pythonGH-132504) * Document the `c` typecode for `multiprocessing.Array`. * Add quotes * Mention that 'w' is not supported (cherry picked from commit 136f6d8) Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
|
GH-143369 is a backport of this pull request to the 3.14 branch. |
pythonGH-132504) * Document the `c` typecode for `multiprocessing.Array`. * Add quotes * Mention that 'w' is not supported (cherry picked from commit 136f6d8) Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
|
GH-143370 is a backport of this pull request to the 3.13 branch. |
python#132504) * Document the `c` typecode for `multiprocessing.Array`. * Add quotes * Mention that 'w' is not supported
I linked to the ctypes types table and added this sentence:
The rest of the diff is just wrapping.
📚 Documentation preview 📚: https://cpython-previews--132504.org.readthedocs.build/