https://github.com/python/cpython/commit/ddd88c74b08f253bd9d2a05528050965c75350fa
commit: ddd88c74b08f253bd9d2a05528050965c75350fa
branch: main
author: Faris Basha TM <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-11-18T18:22:03Z
summary:

Replace stale signature lines in `getopt` docstrings with summaries (#162202)

Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Lib/getopt.py

diff --git a/Lib/getopt.py b/Lib/getopt.py
index 25f3e2439b3e35..272a4bf7d0c282 100644
--- a/Lib/getopt.py
+++ b/Lib/getopt.py
@@ -47,11 +47,10 @@ def __str__(self):
 error = GetoptError # backward compatibility
 
 def getopt(args, shortopts, longopts = []):
-    """getopt(args, options[, long_options]) -> opts, args
+    """Parse command line options and parameter list.
 
-    Parses command line options and parameter list.  args is the
-    argument list to be parsed, without the leading reference to the
-    running program.  Typically, this means "sys.argv[1:]".  shortopts
+    args is the argument list to be parsed, without the leading reference
+    to the running program.  Typically, this means "sys.argv[1:]".  shortopts
     is the string of option letters that the script wants to
     recognize, with options that require an argument followed by a
     colon and options that accept an optional argument followed by
@@ -72,7 +71,6 @@ def getopt(args, shortopts, longopts = []):
     string if the option has no argument.  The options occur in the
     list in the same order in which they were found, thus allowing
     multiple occurrences.  Long and short options may be mixed.
-
     """
 
     opts = []
@@ -92,7 +90,7 @@ def getopt(args, shortopts, longopts = []):
     return opts, args
 
 def gnu_getopt(args, shortopts, longopts = []):
-    """getopt(args, options[, long_options]) -> opts, args
+    """Parse command line options using GNU style scanning.
 
     This function works like getopt(), except that GNU style scanning
     mode is used by default. This means that option and non-option
@@ -103,7 +101,6 @@ def gnu_getopt(args, shortopts, longopts = []):
     If the first character of the option string is '+', or if the
     environment variable POSIXLY_CORRECT is set, then option
     processing stops as soon as a non-option argument is encountered.
-
     """
 
     opts = []

_______________________________________________
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