From 3b172c45cd1f1bc2bb919da1585fe1205cb1e8d6 Mon Sep 17 00:00:00 2001 From: darshan Date: Sat, 6 Dec 2025 13:11:50 +0000 Subject: [PATCH 1/2] test: checking github-wsl connection --- test_PAT.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test_PAT.txt diff --git a/test_PAT.txt b/test_PAT.txt new file mode 100644 index 00000000000000..e69de29bb2d1d6 From 9ce3ca3c522c47b7f64a2083a56c22e0de062fbe Mon Sep 17 00:00:00 2001 From: darshan Date: Thu, 15 Jan 2026 17:33:02 +0000 Subject: [PATCH 2/2] gh-143674: document complex representation using f/d formats in struct --- Doc/library/struct.rst | 4 ++++ Modules/_struct.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index 17fc479fd0c8c9..491b3b22c6b4cf 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -280,6 +280,10 @@ platform-dependent. .. versionchanged:: 3.14 Added support for the ``'F'`` and ``'D'`` formats. +Complex numbers may also be represented using two consecutive floating-point +format characters. In this case, the real part is stored first, followed by +the imaginary part. The format characters ``f`` and ``d`` determine the type +used for each component. Notes: diff --git a/Modules/_struct.c b/Modules/_struct.c index 2acb3df3a30395..ad2e847ae353c6 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2688,7 +2688,9 @@ these can be preceded by a decimal repeat count:\n\ x: pad byte (no data); c:char; b:signed byte; B:unsigned byte;\n\ ?: _Bool (requires C99; if not available, char is used instead)\n\ h:short; H:unsigned short; i:int; I:unsigned int;\n\ - l:long; L:unsigned long; f:float; d:double; e:half-float.\n\ + l:long; L:unsigned long; f:float; d:double; e:half-float.\n\ + For complex numbers, the real and imaginary parts are represented by two\n\ + consecutive values of the specified floating-point type.\n\ Special cases (preceding decimal count indicates length):\n\ s:string (array of char); p: pascal string (with count byte).\n\ Special cases (only available in native format):\n\