summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-09-14 03:32:35 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-09-14 03:32:35 (GMT)
commite0add764688a3f3237749e0c2830b669d2c76ca0 (patch)
treef69c0c5a605892fccf92fb7f25396dfcf2572231 /Doc/library/functions.rst
parent56f37aa965e794046dad62ddef2cb63e59e4f357 (diff)
downloadcpython-e0add764688a3f3237749e0c2830b669d2c76ca0.zip
cpython-e0add764688a3f3237749e0c2830b669d2c76ca0.tar.gz
cpython-e0add764688a3f3237749e0c2830b669d2c76ca0.tar.bz2
#15831: document multiple signatures on different lines. Patch by Chris Jerdonek.
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r--Doc/library/functions.rst38
1 files changed, 25 insertions, 13 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index b3238b1..be5d4c7 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -727,11 +727,16 @@ are always available. They are listed here in alphabetical order.
already arranged into argument tuples, see :func:`itertools.starmap`\.
-.. function:: max(iterable[, args...], *[, key])
+.. function:: max(iterable, *[, key])
+ max(arg1, arg2, *args[, key])
- With a single argument *iterable*, return the largest item of a non-empty
- iterable (such as a string, tuple or list). With more than one argument, return
- the largest of the arguments.
+ Return the largest item in an iterable or the largest of two or more
+ arguments.
+
+ If one positional argument is provided, *iterable* must be a non-empty
+ iterable (such as a non-empty string, tuple or list). The largest item
+ in the iterable is returned. If two or more positional arguments are
+ provided, the largest of the positional arguments is returned.
The optional keyword-only *key* argument specifies a one-argument ordering
function like that used for :meth:`list.sort`.
@@ -750,11 +755,16 @@ are always available. They are listed here in alphabetical order.
:ref:`typememoryview` for more information.
-.. function:: min(iterable[, args...], *[, key])
+.. function:: min(iterable, *[, key])
+ min(arg1, arg2, *args[, key])
+
+ Return the smallest item in an iterable or the smallest of two or more
+ arguments.
- With a single argument *iterable*, return the smallest item of a non-empty
- iterable (such as a string, tuple or list). With more than one argument, return
- the smallest of the arguments.
+ If one positional argument is provided, *iterable* must be a non-empty
+ iterable (such as a non-empty string, tuple or list). The smallest item
+ in the iterable is returned. If two or more positional arguments are
+ provided, the smallest of the positional arguments is returned.
The optional keyword-only *key* argument specifies a one-argument ordering
function like that used for :meth:`list.sort`.
@@ -957,16 +967,16 @@ are always available. They are listed here in alphabetical order.
must be of integer types, and *y* must be non-negative.
-.. function:: print([object, ...], *, sep=' ', end='\\n', file=sys.stdout)
+.. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout)
- Print *object*\(s) to the stream *file*, separated by *sep* and followed by
+ Print *objects* to the stream *file*, separated by *sep* and followed by
*end*. *sep*, *end* and *file*, if present, must be given as keyword
arguments.
All non-keyword arguments are converted to strings like :func:`str` does and
written to the stream, separated by *sep* and followed by *end*. Both *sep*
and *end* must be strings; they can also be ``None``, which means to use the
- default values. If no *object* is given, :func:`print` will just write
+ default values. If no *objects* are given, :func:`print` will just write
*end*.
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.
.. XXX does accept objects with __index__ too
-.. function:: range([start,] stop[, step])
+.. function:: range(stop)
+ range(start, stop[, step])
This is a versatile function to create iterables yielding arithmetic
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.
``x.foobar = 123``.
-.. function:: slice([start,] stop[, step])
+.. function:: slice(stop)
+ slice(start, stop[, step])
.. index:: single: Numerical Python