[3.15] Document getopt and gnu_getopt longopts argument as string (GH-153976) (#154095)

tomasr8 <[email protected]>
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/bc8af591acee4da62c60d97924e546a7e2af0576
commit: bc8af591acee4da62c60d97924e546a7e2af0576
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: tomasr8 <[email protected]>
date: 2026-07-19T13:16:32+02:00
summary:

[3.15] Document getopt and gnu_getopt longopts argument as string (GH-153976) (#154095)

Document getopt and gnu_getopt longopts argument as string (GH-153976)

Document getopt and gnu_getopt longopts as string
(cherry picked from commit 16562f1ce31ba654c42eee644f253bb31cff9f9d)

Co-authored-by: Florian Freitag <[email protected]>

files:
M Doc/library/getopt.rst

diff --git a/Doc/library/getopt.rst b/Doc/library/getopt.rst
index 5c63009e22d58c..9995f114d063e8 100644
--- a/Doc/library/getopt.rst
+++ b/Doc/library/getopt.rst
@@ -62,6 +62,8 @@ exception:
    option ``--fo`` will match as ``--foo``, but ``--f`` will
    not match uniquely, so :exc:`GetoptError` will be raised.
 
+   If *longopts* is a string it gets treated as a list of a single element.
+
    The return value consists of two elements: the first is a list of ``(option,
    value)`` pairs; the second is the list of program arguments left after the
    option list was stripped (this is a trailing slice of *args*).  Each

_______________________________________________
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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.