From f17e5ddabb532a7f685cf1d81247a01c7a47f840 Mon Sep 17 00:00:00 2001 From: monkeyman192 Date: Tue, 8 Oct 2024 23:41:46 +1100 Subject: [PATCH] [3.13] gh-112433 add versionadded for `ctypes.Structure._align_` (GH-125087) (cherry picked from commit 5967dd8a4de60a418de84d1d1d9efc063ad12c47) Co-authored-by: monkeyman192 Co-authored-by: Kumar Aditya --- Doc/library/ctypes.rst | 2 ++ Doc/whatsnew/3.13.rst | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 12b44569271efc..bc3a50a633f2ff 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -2540,6 +2540,8 @@ fields, or any other data types containing pointer type fields. the structure when being packed or unpacked to/from memory. Setting this attribute to 0 is the same as not setting it at all. + .. versionadded:: 3.13 + .. attribute:: _anonymous_ An optional sequence that lists the names of unnamed (anonymous) fields. diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index a47d5e077a357b..565f74149725d5 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -814,6 +814,10 @@ ctypes See :gh:`124520` for discussion and links to changes in some affected projects. +* :class:`ctypes.Structure` objects have a new :attr:`~ctypes.Structure._align_` + attribute which allows the alignment of the structure being packed to/from + memory to be specified explicitly. + (Contributed by Matt Sanderson in :gh:`112433`) dbm ---