]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document getopt and gnu_getopt longopts argument as string (#153976)
authorFlorian Freitag <flohacksfriday@gmail.com>
Sun, 19 Jul 2026 10:26:26 +0000 (12:26 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 10:26:26 +0000 (12:26 +0200)
Document getopt and gnu_getopt longopts as string

Doc/library/getopt.rst

index 5c63009e22d58c4d27d41f72a95f243cdc600b59..9995f114d063e82c3181204abca20ef240d5ee40 100644 (file)
@@ -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