From c9248c42d5ec1a2913e338e704ed15c0392aea3c Mon Sep 17 00:00:00 2001 From: moneebullah25 Date: Sun, 11 Jan 2026 02:53:24 +0000 Subject: [PATCH 1/2] gh-143674: Document F/D complex format characters in struct module Add documentation for the F (complex from two floats) and D (complex from two doubles) format characters in the struct module docstring. These format characters were implemented but not documented. --- Modules/_struct.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/_struct.c b/Modules/_struct.c index 2acb3df3a30395..77eff7595299cc 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2689,6 +2689,7 @@ these can be preceded by a decimal repeat count:\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\ + F:complex (two floats); D:complex (two doubles).\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\ From 614e8ac87d1d73345ea61f720ea3208982c65b60 Mon Sep 17 00:00:00 2001 From: Muneeb Ullah <58388634+moneebullah25@users.noreply.github.com> Date: Sun, 11 Jan 2026 02:28:31 -0500 Subject: [PATCH 2/2] fixed Modules/_struct.c Co-authored-by: Sergey B Kirpichev --- Modules/_struct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_struct.c b/Modules/_struct.c index 77eff7595299cc..9685bdc2af6371 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2689,7 +2689,7 @@ these can be preceded by a decimal repeat count:\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\ - F:complex (two floats); D:complex (two doubles).\n\ + F:float complex; D:double complex.\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\