https://github.com/python/cpython/commit/7a918411a300ddeef06d7f984bd23de8f6438421
commit: 7a918411a300ddeef06d7f984bd23de8f6438421
branch: main
author: Owen Carey <[email protected]>
committer: savannahostrowski <[email protected]>
date: 2026-09-05T17:00:22Z
summary:

gh-127296: Document that argparse count action starts from a non-zero default 
(#156908)

Co-authored-by: Savannah Ostrowski <[email protected]>

files:
M Doc/library/argparse.rst

diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index b2318ddace8514..fc5302d875fc1f 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -835,7 +835,9 @@ how the command-line arguments should be handled. The 
supplied actions are:
     >>> parser.parse_args(['-vvv'])
     Namespace(verbose=3)
 
-  Note, the *default* will be ``None`` unless explicitly set to *0*.
+  Unless explicitly set, the *default* will be ``None``. If the default
+  value is a non-zero number, the count starts from that number rather
+  than from zero.
 
 * ``'help'`` - This prints a complete help message for all the options in the
   current parser and then exits. By default a help action is automatically

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to