Skip to content

Commit 12458ea

Browse files
farisbashaStanFromIreland
authored andcommitted
Replace stale signature lines in getopt docstrings with summaries (GH-162202)
(cherry picked from commit ddd88c7) Co-authored-by: Faris Basha TM <72191505+farisbasha@users.noreply.github.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 78d46ec commit 12458ea

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎Lib/getopt.py‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ def __str__(self):
4747
error = GetoptError # backward compatibility
4848

4949
def getopt(args, shortopts, longopts = []):
50-
"""getopt(args, options[, long_options]) -> opts, args
50+
"""Parse command line options and parameter list.
5151
52-
Parses command line options and parameter list. args is the
53-
argument list to be parsed, without the leading reference to the
54-
running program. Typically, this means "sys.argv[1:]". shortopts
52+
args is the argument list to be parsed, without the leading reference
53+
to the running program. Typically, this means "sys.argv[1:]". shortopts
5554
is the string of option letters that the script wants to
5655
recognize, with options that require an argument followed by a
5756
colon and options that accept an optional argument followed by
@@ -72,7 +71,6 @@ def getopt(args, shortopts, longopts = []):
7271
string if the option has no argument. The options occur in the
7372
list in the same order in which they were found, thus allowing
7473
multiple occurrences. Long and short options may be mixed.
75-
7674
"""
7775

7876
opts = []
@@ -92,7 +90,7 @@ def getopt(args, shortopts, longopts = []):
9290
return opts, args
9391

9492
def gnu_getopt(args, shortopts, longopts = []):
95-
"""getopt(args, options[, long_options]) -> opts, args
93+
"""Parse command line options using GNU style scanning.
9694
9795
This function works like getopt(), except that GNU style scanning
9896
mode is used by default. This means that option and non-option
@@ -103,7 +101,6 @@ def gnu_getopt(args, shortopts, longopts = []):
103101
If the first character of the option string is '+', or if the
104102
environment variable POSIXLY_CORRECT is set, then option
105103
processing stops as soon as a non-option argument is encountered.
106-
107104
"""
108105

109106
opts = []

0 commit comments

Comments
 (0)