From 175c53a39f445e8593b23d8aa8abdfd256ab8c40 Mon Sep 17 00:00:00 2001 From: Timothy Poon <62692924+ptim0626@users.noreply.github.com> Date: Fri, 7 Aug 2026 14:43:47 +0100 Subject: [PATCH 1/3] Clarify the change of behaviour from 3.14 about parsing negative numbers --- Doc/library/argparse.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 8ae96311026f33f..860d1b7c336b30d 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1624,6 +1624,11 @@ argument:: See also :ref:`the argparse howto on ambiguous arguments ` for more details. + .. versionchanged:: 3.14 + Negative numbers in scientific notation (e.g. ``-2.5e-6``), with + underscores (e.g. ``-1_234.5``) and complex numbers (e.g. ``-1.2e-3j``) + are recognized as negative numbers. + .. _prefix-matching: Argument abbreviations (prefix matching) From 0e0c6b815542e2f6b59ec06faad751352ecd818a Mon Sep 17 00:00:00 2001 From: Timothy Poon <62692924+ptim0626@users.noreply.github.com> Date: Fri, 7 Aug 2026 16:23:06 +0100 Subject: [PATCH 2/3] Remove e.g. usage per the style guide --- Doc/library/argparse.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 860d1b7c336b30d..d463af1e02372ba 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1625,9 +1625,9 @@ See also :ref:`the argparse howto on ambiguous arguments Date: Fri, 7 Aug 2026 22:26:16 +0100 Subject: [PATCH 3/3] Rephrase and fix indentation Co-authored-by: Savannah Ostrowski --- Doc/library/argparse.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index d463af1e02372ba..39ca1d542e4127c 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1624,10 +1624,10 @@ argument:: See also :ref:`the argparse howto on ambiguous arguments ` for more details. - .. versionchanged:: 3.14 - Negative numbers in scientific notation (``-2.5e-6``), with underscores - (``-1_234.5``) and complex numbers (``-1.2e-3j``) are recognized as - negative numbers. +.. versionchanged:: 3.14 + Negative-number matching was expanded to include numbers in scientific + notation (``-2.5e-6``), numbers containing underscores (``-1_234.5``), + and complex numbers (``-1.2e-3j``). .. _prefix-matching: