]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112433 add versionadded for `ctypes.Structure._align_` (#125087)
authormonkeyman192 <monkey_man_192@yahoo.com.au>
Tue, 8 Oct 2024 12:41:46 +0000 (23:41 +1100)
committerGitHub <noreply@github.com>
Tue, 8 Oct 2024 12:41:46 +0000 (12:41 +0000)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Doc/library/ctypes.rst
Doc/whatsnew/3.13.rst

index 535c5173be50de2a4a385a2061ccac87de4f8525..d76b8d4809c078b4cf51676d70be456909f633a7 100644 (file)
@@ -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
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
 ---