]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-148675: Add Zd/Zf formats to array, ctypes, memoryview, struct (#148676)
authorVictor Stinner <vstinner@python.org>
Mon, 4 May 2026 14:14:23 +0000 (16:14 +0200)
committerGitHub <noreply@github.com>
Mon, 4 May 2026 14:14:23 +0000 (16:14 +0200)
commit6e6f9053e368a8c8b05872743f9ac04c49418d7e
tree4fabb790ec88e47714396e0ded7d1925e414304c
parent72f29dc704812aa846b10323a31743d6df37cc2c
gh-148675: Add Zd/Zf formats to array, ctypes, memoryview, struct (#148676)

* Add Zd/Zf format support to array, memoryview and struct.
* ctypes: Replace F/D/G complex format with Zf/Zd/Zg.
* Modify array, ctypes and struct modules to support format strings
  longer than 1 character (such as "Zd").
* Change array.typecodes type from str to tuple.
22 files changed:
Doc/library/array.rst
Doc/library/ctypes.rst
Doc/library/struct.rst
Doc/whatsnew/3.15.rst
Lib/ctypes/__init__.py
Lib/test/test_array.py
Lib/test/test_buffer.py
Lib/test/test_ctypes/test_c_simple_type_meta.py
Lib/test/test_ctypes/test_numbers.py
Lib/test/test_memoryview.py
Lib/test/test_struct.py
Misc/NEWS.d/next/Library/2026-04-17-13-56-44.gh-issue-148675.f1kG70.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2026-05-02-12-30-35.gh-issue-148675.cu2YFT.rst [new file with mode: 0644]
Misc/NEWS.d/next/Library/2026-05-02-15-58-08.gh-issue-148675.b3ZNlj.rst [new file with mode: 0644]
Modules/_ctypes/_ctypes.c
Modules/_ctypes/callproc.c
Modules/_ctypes/cfield.c
Modules/_ctypes/ctypes.h
Modules/_struct.c
Modules/arraymodule.c
Modules/clinic/arraymodule.c.h
Objects/memoryobject.c