From 12458ea1fa0ddfc668f3a6fe8c385fd32c8f73ac Mon Sep 17 00:00:00 2001 From: Faris Basha TM <72191505+farisbasha@users.noreply.github.com> Date: Wed, 18 Nov 2026 23:52:03 +0530 Subject: [PATCH] Replace stale signature lines in `getopt` docstrings with summaries (GH-162202) (cherry picked from commit ddd88c74b08f253bd9d2a05528050965c75350fa) Co-authored-by: Faris Basha TM <72191505+farisbasha@users.noreply.github.com> Co-authored-by: Stan Ulbrych --- Lib/getopt.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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 = []