Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0add76

Browse files
committed
#15831: document multiple signatures on different lines. Patch by Chris Jerdonek.
1 parent 56f37aa commit e0add76

13 files changed

Lines changed: 89 additions & 46 deletions

Doc/library/argparse.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ command-line arguments from :data:`sys.argv`.
130130
ArgumentParser objects
131131
----------------------
132132

133-
.. class:: ArgumentParser([description], [epilog], [prog], [usage], [add_help], \
134-
[argument_default], [parents], [prefix_chars], \
135-
[conflict_handler], [formatter_class])
133+
.. class:: ArgumentParser(prog=None, usage=None, description=None, \
134+
epilog=None, parents=[], \
135+
formatter_class=argparse.HelpFormatter, \
136+
prefix_chars='-', fromfile_prefix_chars=None, \
137+
argument_default=None, conflict_handler='error', \
138+
add_help=True)
136139

137140
Create a new :class:`ArgumentParser` object. Each parameter has its own more
138141
detailed description below, but in short they are:

Doc/library/configparser.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,8 @@ ConfigParser Objects
10511051
*fallback*.
10521052

10531053

1054-
.. method:: items([section], raw=False, vars=None)
1054+
.. method:: items(raw=False, vars=None)
1055+
items(section, raw=False, vars=None)
10551056

10561057
When *section* is not given, return a list of *section_name*,
10571058
*section_proxy* pairs, including DEFAULTSECT.

Doc/library/curses.rst

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ The module :mod:`curses` defines the following functions:
377377
is to be displayed.
378378

379379

380-
.. function:: newwin([nlines, ncols,] begin_y, begin_x)
380+
.. function:: newwin(begin_y, begin_x)
381+
newwin(nlines, ncols, begin_y, begin_x)
381382

382383
Return a new window, whose left-upper corner is at ``(begin_y, begin_x)``, and
383384
whose height/width is *nlines*/*ncols*.
@@ -645,7 +646,8 @@ Window objects, as returned by :func:`initscr` and :func:`newwin` above, have
645646
the following methods:
646647

647648

648-
.. method:: window.addch([y, x,] ch[, attr])
649+
.. method:: window.addch(ch[, attr])
650+
window.addch(y, x, ch[, attr])
649651

650652
.. note::
651653

@@ -659,13 +661,15 @@ the following methods:
659661
position and attributes are the current settings for the window object.
660662

661663

662-
.. method:: window.addnstr([y, x,] str, n[, attr])
664+
.. method:: window.addnstr(str, n[, attr])
665+
window.addnstr(y, x, str, n[, attr])
663666

664667
Paint at most *n* characters of the string *str* at ``(y, x)`` with attributes
665668
*attr*, overwriting anything previously on the display.
666669

667670

668-
.. method:: window.addstr([y, x,] str[, attr])
671+
.. method:: window.addstr(str[, attr])
672+
window.addstr(y, x, str[, attr])
669673

670674
Paint the string *str* at ``(y, x)`` with attributes *attr*, overwriting
671675
anything previously on the display.
@@ -752,7 +756,10 @@ the following methods:
752756
*bs* are *horch*. The default corner characters are always used by this function.
753757

754758

755-
.. method:: window.chgat([y, x, ] [num,] attr)
759+
.. method:: window.chgat(attr)
760+
window.chgat(num, attr)
761+
window.chgat(y, x, attr)
762+
window.chgat(y, x, num, attr)
756763

757764
Set the attributes of *num* characters at the current cursor position, or at
758765
position ``(y, x)`` if supplied. If no value of *num* is given or *num* = -1,
@@ -801,7 +808,8 @@ the following methods:
801808
Delete the line under the cursor. All following lines are moved up by one line.
802809

803810

804-
.. method:: window.derwin([nlines, ncols,] begin_y, begin_x)
811+
.. method:: window.derwin(begin_y, begin_x)
812+
window.derwin(nlines, ncols, begin_y, begin_x)
805813

806814
An abbreviation for "derive window", :meth:`derwin` is the same as calling
807815
:meth:`subwin`, except that *begin_y* and *begin_x* are relative to the origin
@@ -876,7 +884,8 @@ the following methods:
876884
upper-left corner.
877885

878886

879-
.. method:: window.hline([y, x,] ch, n)
887+
.. method:: window.hline(ch, n)
888+
window.hline(y, x, ch, n)
880889

881890
Display a horizontal line starting at ``(y, x)`` with length *n* consisting of
882891
the character *ch*.
@@ -910,7 +919,8 @@ the following methods:
910919
the character proper, and upper bits are the attributes.
911920

912921

913-
.. method:: window.insch([y, x,] ch[, attr])
922+
.. method:: window.insch(ch[, attr])
923+
window.insch(y, x, ch[, attr])
914924

915925
Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line from
916926
position *x* right by one character.
@@ -931,7 +941,8 @@ the following methods:
931941
line.
932942

933943

934-
.. method:: window.insnstr([y, x,] str, n [, attr])
944+
.. method:: window.insnstr(str, n[, attr])
945+
window.insnstr(y, x, str, n[, attr])
935946

936947
Insert a character string (as many characters as will fit on the line) before
937948
the character under the cursor, up to *n* characters. If *n* is zero or
@@ -940,15 +951,17 @@ the following methods:
940951
The cursor position does not change (after moving to *y*, *x*, if specified).
941952

942953

943-
.. method:: window.insstr([y, x, ] str [, attr])
954+
.. method:: window.insstr(str[, attr])
955+
window.insstr(y, x, str[, attr])
944956

945957
Insert a character string (as many characters as will fit on the line) before
946958
the character under the cursor. All characters to the right of the cursor are
947959
shifted right, with the rightmost characters on the line being lost. The cursor
948960
position does not change (after moving to *y*, *x*, if specified).
949961

950962

951-
.. method:: window.instr([y, x] [, n])
963+
.. method:: window.instr([n])
964+
window.instr(y, x[, n])
952965

953966
Return a string of characters, extracted from the window starting at the
954967
current cursor position, or at *y*, *x* if specified. Attributes are stripped
@@ -1123,13 +1136,15 @@ the following methods:
11231136
Turn on attribute *A_STANDOUT*.
11241137

11251138

1126-
.. method:: window.subpad([nlines, ncols,] begin_y, begin_x)
1139+
.. method:: window.subpad(begin_y, begin_x)
1140+
window.subpad(nlines, ncols, begin_y, begin_x)
11271141

11281142
Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, and
11291143
whose width/height is *ncols*/*nlines*.
11301144

11311145

1132-
.. method:: window.subwin([nlines, ncols,] begin_y, begin_x)
1146+
.. method:: window.subwin(begin_y, begin_x)
1147+
window.subwin(nlines, ncols, begin_y, begin_x)
11331148

11341149
Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, and
11351150
whose width/height is *ncols*/*nlines*.
@@ -1186,7 +1201,8 @@ the following methods:
11861201
:meth:`refresh`.
11871202

11881203

1189-
.. method:: window.vline([y, x,] ch, n)
1204+
.. method:: window.vline(ch, n)
1205+
window.vline(y, x, ch, n)
11901206

11911207
Display a vertical line starting at ``(y, x)`` with length *n* consisting of the
11921208
character *ch*.

Doc/library/functions.rst

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -727,11 +727,16 @@ are always available. They are listed here in alphabetical order.
727727
already arranged into argument tuples, see :func:`itertools.starmap`\.
728728

729729

730-
.. function:: max(iterable[, args...], *[, key])
730+
.. function:: max(iterable, *[, key])
731+
max(arg1, arg2, *args[, key])
731732
732-
With a single argument *iterable*, return the largest item of a non-empty
733-
iterable (such as a string, tuple or list). With more than one argument, return
734-
the largest of the arguments.
733+
Return the largest item in an iterable or the largest of two or more
734+
arguments.
735+
736+
If one positional argument is provided, *iterable* must be a non-empty
737+
iterable (such as a non-empty string, tuple or list). The largest item
738+
in the iterable is returned. If two or more positional arguments are
739+
provided, the largest of the positional arguments is returned.
735740

736741
The optional keyword-only *key* argument specifies a one-argument ordering
737742
function like that used for :meth:`list.sort`.
@@ -750,11 +755,16 @@ are always available. They are listed here in alphabetical order.
750755
:ref:`typememoryview` for more information.
751756

752757

753-
.. function:: min(iterable[, args...], *[, key])
758+
.. function:: min(iterable, *[, key])
759+
min(arg1, arg2, *args[, key])
760+
761+
Return the smallest item in an iterable or the smallest of two or more
762+
arguments.
754763

755-
With a single argument *iterable*, return the smallest item of a non-empty
756-
iterable (such as a string, tuple or list). With more than one argument, return
757-
the smallest of the arguments.
764+
If one positional argument is provided, *iterable* must be a non-empty
765+
iterable (such as a non-empty string, tuple or list). The smallest item
766+
in the iterable is returned. If two or more positional arguments are
767+
provided, the smallest of the positional arguments is returned.
758768

759769
The optional keyword-only *key* argument specifies a one-argument ordering
760770
function like that used for :meth:`list.sort`.
@@ -957,16 +967,16 @@ are always available. They are listed here in alphabetical order.
957967
must be of integer types, and *y* must be non-negative.
958968

959969

960-
.. function:: print([object, ...], *, sep=' ', end='\\n', file=sys.stdout)
970+
.. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout)
961971

962-
Print *object*\(s) to the stream *file*, separated by *sep* and followed by
972+
Print *objects* to the stream *file*, separated by *sep* and followed by
963973
*end*. *sep*, *end* and *file*, if present, must be given as keyword
964974
arguments.
965975

966976
All non-keyword arguments are converted to strings like :func:`str` does and
967977
written to the stream, separated by *sep* and followed by *end*. Both *sep*
968978
and *end* must be strings; they can also be ``None``, which means to use the
969-
default values. If no *object* is given, :func:`print` will just write
979+
default values. If no *objects* are given, :func:`print` will just write
970980
*end*.
971981

972982
The *file* argument must be an object with a ``write(string)`` method; if it
@@ -1045,7 +1055,8 @@ are always available. They are listed here in alphabetical order.
10451055

10461056

10471057
.. XXX does accept objects with __index__ too
1048-
.. function:: range([start,] stop[, step])
1058+
.. function:: range(stop)
1059+
range(start, stop[, step])
10491060

10501061
This is a versatile function to create iterables yielding arithmetic
10511062
progressions. It is most often used in :keyword:`for` loops. The arguments
@@ -1160,7 +1171,8 @@ are always available. They are listed here in alphabetical order.
11601171
``x.foobar = 123``.
11611172

11621173

1163-
.. function:: slice([start,] stop[, step])
1174+
.. function:: slice(stop)
1175+
slice(start, stop[, step])
11641176

11651177
.. index:: single: Numerical Python
11661178

Doc/library/http.client.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ HTTPS protocols. It is normally not used directly --- the module
2727
The module provides the following classes:
2828

2929

30-
.. class:: HTTPConnection(host, port=None[, strict[, timeout[, source_address]]])
30+
.. class:: HTTPConnection(host, port=None[, strict][, timeout], \
31+
source_address=None)
3132

3233
An :class:`HTTPConnection` instance represents one transaction with an HTTP
3334
server. It should be instantiated passing it a host and optional port
@@ -55,7 +56,10 @@ The module provides the following classes:
5556
are not supported anymore.
5657

5758

58-
.. class:: HTTPSConnection(host, port=None, key_file=None, cert_file=None[, strict[, timeout[, source_address]]], *, context=None, check_hostname=None)
59+
.. class:: HTTPSConnection(host, port=None, key_file=None, \
60+
cert_file=None[, strict][, timeout], \
61+
source_address=None, *, context=None, \
62+
check_hostname=None)
5963
6064
A subclass of :class:`HTTPConnection` that uses SSL for communication with
6165
secure servers. Default port is ``443``. If *context* is specified, it

Doc/library/itertools.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ loops that truncate the stream.
363363
self.currkey = self.keyfunc(self.currvalue)
364364

365365

366-
.. function:: islice(iterable, [start,] stop [, step])
366+
.. function:: islice(iterable, stop)
367+
islice(iterable, start, stop[, step])
367368

368369
Make an iterator that returns selected elements from the iterable. If *start* is
369370
non-zero, then elements from the iterable are skipped until start is reached.

Doc/library/multiprocessing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ The :mod:`multiprocessing` package mostly replicates the API of the
298298
:class:`Process` and exceptions
299299
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
300300

301-
.. class:: Process([group[, target[, name[, args[, kwargs]]]]])
301+
.. class:: Process(group=None, target=None, name=None, args=(), kwargs={})
302302

303303
Process objects represent activity that is run in a separate process. The
304304
:class:`Process` class has equivalents of all the methods of

Doc/library/optparse.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ You're free to define as many short option strings and as many long option
273273
strings as you like (including zero), as long as there is at least one option
274274
string overall.
275275

276-
The option strings passed to :meth:`add_option` are effectively labels for the
276+
The option strings passed to :meth:`OptionParser.add_option` are effectively
277+
labels for the
277278
option defined by that call. For brevity, we will frequently refer to
278279
*encountering an option* on the command line; in reality, :mod:`optparse`
279280
encounters *option strings* and looks up options from them.
@@ -892,7 +893,8 @@ long option strings, but you must specify at least one overall option string.
892893
The canonical way to create an :class:`Option` instance is with the
893894
:meth:`add_option` method of :class:`OptionParser`.
894895

895-
.. method:: OptionParser.add_option(opt_str[, ...], attr=value, ...)
896+
.. method:: OptionParser.add_option(option)
897+
OptionParser.add_option(*opt_str, attr=value, ...)
896898
897899
To define an option with only a short option string::
898900

Doc/library/ossaudiodev.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ the standard audio interface for Linux and recent versions of FreeBSD.
6363
``ossaudiodev.error``.)
6464

6565

66-
.. function:: open([device, ]mode)
66+
.. function:: open(mode)
67+
open(device, mode)
6768

6869
Open an audio device and return an OSS audio device object. This object
6970
supports many file-like methods, such as :meth:`read`, :meth:`write`, and

Doc/library/random.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ from sources provided by the operating system.
4646

4747
Bookkeeping functions:
4848

49-
.. function:: seed([x], version=2)
49+
.. function:: seed(a=None, version=2)
5050

5151
Initialize the random number generator.
5252

53-
If *x* is omitted or ``None``, the current system time is used. If
53+
If *a* is omitted or ``None``, the current system time is used. If
5454
randomness sources are provided by the operating system, they are used
5555
instead of the system time (see the :func:`os.urandom` function for details
5656
on availability).
5757

58-
If *x* is an int, it is used directly.
58+
If *a* is an int, it is used directly.
5959

6060
With version 2 (the default), a :class:`str`, :class:`bytes`, or :class:`bytearray`
6161
object gets converted to an :class:`int` and all of its bits are used. With version 1,
62-
the :func:`hash` of *x* is used instead.
62+
the :func:`hash` of *a* is used instead.
6363

6464
.. versionchanged:: 3.2
6565
Moved to the version 2 scheme which uses all of the bits in a string seed.
@@ -87,7 +87,8 @@ Bookkeeping functions:
8787

8888
Functions for integers:
8989

90-
.. function:: randrange([start,] stop[, step])
90+
.. function:: randrange(stop)
91+
randrange(start, stop[, step])
9192

9293
Return a randomly selected element from ``range(start, stop, step)``. This is
9394
equivalent to ``choice(range(start, stop, step))``, but doesn't actually build a

0 commit comments

Comments
 (0)