]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-112433 add versionadded for `ctypes.Structure._align_` (GH-125087) (#125113)
authorJelle Zijlstra <jelle.zijlstra@gmail.com>
Tue, 8 Oct 2024 14:24:27 +0000 (07:24 -0700)
committerGitHub <noreply@github.com>
Tue, 8 Oct 2024 14:24:27 +0000 (14:24 +0000)
(cherry picked from commit 5967dd8a4de60a418de84d1d1d9efc063ad12c47)

Co-authored-by: monkeyman192 <monkey_man_192@yahoo.com.au>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Doc/library/ctypes.rst
Doc/whatsnew/3.13.rst

index 12b44569271efcf2d45b35423a124e8ad186d0d2..bc3a50a633f2ffbf74d41fe0a0f717e22163f3cf 100644 (file)
@@ -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.
index a47d5e077a357b8de2e79ca92f90b279c593ae90..565f74149725d5df6d1611b1ed6f125d123c5a7d 100644 (file)
@@ -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
 ---