From: monkeyman192 Date: Tue, 8 Oct 2024 12:41:46 +0000 (+1100) Subject: gh-112433 add versionadded for `ctypes.Structure._align_` (#125087) X-Git-Tag: v3.14.0a1~143 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5967dd8a4de60a418de84d1d1d9efc063ad12c47;p=thirdparty%2FPython%2Fcpython.git gh-112433 add versionadded for `ctypes.Structure._align_` (#125087) Co-authored-by: Kumar Aditya --- diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 535c5173be50..d76b8d4809c0 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -2589,6 +2589,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:: _layout_ An optional string naming the struct/union layout. It can currently diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index a47d5e077a35..565f74149725 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 ---