From 3625730955dbbf11bd235ea3cb85d4b4817f275e Mon Sep 17 00:00:00 2001 From: monkeyman192 Date: Tue, 8 Oct 2024 18:38:51 +1100 Subject: [PATCH 1/3] Docs: Add versionadded value and whatsnew snippet (gh-112433) --- 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 535c5173be50de..d76b8d4809c078 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 a47d5e077a357b..a2b28d07d17291 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:`.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 --- From a529512694a7f398564d3de5d9b5cb0c5215c5b7 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Tue, 8 Oct 2024 17:38:50 +0530 Subject: [PATCH 2/3] Update Doc/whatsnew/3.13.rst --- Doc/whatsnew/3.13.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index a2b28d07d17291..76f7864906299a 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -814,7 +814,7 @@ ctypes See :gh:`124520` for discussion and links to changes in some affected projects. -* :class:`ctypes.Structure` objects have a new :attr:`.Structure._align_` +* :class:`ctypes.Structure` objects have a new :attr:`~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`) From 3bbc61702d41118443ce43f255f649f1cdcf5d68 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Tue, 8 Oct 2024 17:46:12 +0530 Subject: [PATCH 3/3] Update Doc/whatsnew/3.13.rst --- Doc/whatsnew/3.13.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 76f7864906299a..565f74149725d5 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -814,7 +814,7 @@ ctypes See :gh:`124520` for discussion and links to changes in some affected projects. -* :class:`ctypes.Structure` objects have a new :attr:`~Structure._align_` +* :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`)