Doc: Make functions.html readable again. (GH-99476)

(cherry picked from commit 858cb79486)

Co-authored-by: Julien Palard <julien@palard.fr>
This commit is contained in:
Miss Islington (bot) 2022-11-19 02:58:32 -08:00 committed by GitHub
parent 7e742379af
commit a15ab1ec65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 60 additions and 60 deletions

View File

@ -54,14 +54,14 @@ are always available. They are listed here in alphabetical order.
.. |func-bytearray| replace:: ``bytearray()`` .. |func-bytearray| replace:: ``bytearray()``
.. |func-bytes| replace:: ``bytes()`` .. |func-bytes| replace:: ``bytes()``
.. function:: abs(x, /) .. function:: abs(x)
Return the absolute value of a number. The argument may be an Return the absolute value of a number. The argument may be an
integer, a floating point number, or an object implementing :meth:`__abs__`. integer, a floating point number, or an object implementing :meth:`__abs__`.
If the argument is a complex number, its magnitude is returned. If the argument is a complex number, its magnitude is returned.
.. function:: aiter(async_iterable, /) .. function:: aiter(async_iterable)
Return an :term:`asynchronous iterator` for an :term:`asynchronous iterable`. Return an :term:`asynchronous iterator` for an :term:`asynchronous iterable`.
Equivalent to calling ``x.__aiter__()``. Equivalent to calling ``x.__aiter__()``.
@ -70,7 +70,7 @@ are always available. They are listed here in alphabetical order.
.. versionadded:: 3.10 .. versionadded:: 3.10
.. function:: all(iterable, /) .. function:: all(iterable)
Return ``True`` if all elements of the *iterable* are true (or if the iterable Return ``True`` if all elements of the *iterable* are true (or if the iterable
is empty). Equivalent to:: is empty). Equivalent to::
@ -82,8 +82,8 @@ are always available. They are listed here in alphabetical order.
return True return True
.. awaitablefunction:: anext(async_iterator, /) .. awaitablefunction:: anext(async_iterator)
anext(async_iterator, default, /) anext(async_iterator, default)
When awaited, return the next item from the given :term:`asynchronous When awaited, return the next item from the given :term:`asynchronous
iterator`, or *default* if given and the iterator is exhausted. iterator`, or *default* if given and the iterator is exhausted.
@ -98,7 +98,7 @@ are always available. They are listed here in alphabetical order.
.. versionadded:: 3.10 .. versionadded:: 3.10
.. function:: any(iterable, /) .. function:: any(iterable)
Return ``True`` if any element of the *iterable* is true. If the iterable Return ``True`` if any element of the *iterable* is true. If the iterable
is empty, return ``False``. Equivalent to:: is empty, return ``False``. Equivalent to::
@ -110,7 +110,7 @@ are always available. They are listed here in alphabetical order.
return False return False
.. function:: ascii(object, /) .. function:: ascii(object)
As :func:`repr`, return a string containing a printable representation of an As :func:`repr`, return a string containing a printable representation of an
object, but escape the non-ASCII characters in the string returned by object, but escape the non-ASCII characters in the string returned by
@ -118,7 +118,7 @@ are always available. They are listed here in alphabetical order.
similar to that returned by :func:`repr` in Python 2. similar to that returned by :func:`repr` in Python 2.
.. function:: bin(x, /) .. function:: bin(x)
Convert an integer number to a binary string prefixed with "0b". The result Convert an integer number to a binary string prefixed with "0b". The result
is a valid Python expression. If *x* is not a Python :class:`int` object, it is a valid Python expression. If *x* is not a Python :class:`int` object, it
@ -140,7 +140,7 @@ are always available. They are listed here in alphabetical order.
See also :func:`format` for more information. See also :func:`format` for more information.
.. class:: bool(x=False, /) .. class:: bool(x=False)
Return a Boolean value, i.e. one of ``True`` or ``False``. *x* is converted Return a Boolean value, i.e. one of ``True`` or ``False``. *x* is converted
using the standard :ref:`truth testing procedure <truth>`. If *x* is false using the standard :ref:`truth testing procedure <truth>`. If *x* is false
@ -222,7 +222,7 @@ are always available. They are listed here in alphabetical order.
See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`. See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`.
.. function:: callable(object, /) .. function:: callable(object)
Return :const:`True` if the *object* argument appears callable, Return :const:`True` if the *object* argument appears callable,
:const:`False` if not. If this returns ``True``, it is still possible that a :const:`False` if not. If this returns ``True``, it is still possible that a
@ -235,7 +235,7 @@ are always available. They are listed here in alphabetical order.
in Python 3.2. in Python 3.2.
.. function:: chr(i, /) .. function:: chr(i)
Return the string representing a character whose Unicode code point is the Return the string representing a character whose Unicode code point is the
integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while
@ -364,7 +364,7 @@ are always available. They are listed here in alphabetical order.
.. class:: complex(real=0, imag=0) .. class:: complex(real=0, imag=0)
complex(string, /) complex(string)
Return a complex number with the value *real* + *imag*\*1j or convert a string Return a complex number with the value *real* + *imag*\*1j or convert a string
or number to a complex number. If the first parameter is a string, it will or number to a complex number. If the first parameter is a string, it will
@ -397,7 +397,7 @@ are always available. They are listed here in alphabetical order.
:meth:`__float__` are not defined. :meth:`__float__` are not defined.
.. function:: delattr(object, name, /) .. function:: delattr(object, name)
This is a relative of :func:`setattr`. The arguments are an object and a This is a relative of :func:`setattr`. The arguments are an object and a
string. The string must be the name of one of the object's attributes. The string. The string must be the name of one of the object's attributes. The
@ -408,8 +408,8 @@ are always available. They are listed here in alphabetical order.
.. _func-dict: .. _func-dict:
.. class:: dict(**kwarg) .. class:: dict(**kwarg)
dict(mapping, /, **kwarg) dict(mapping, **kwarg)
dict(iterable, /, **kwarg) dict(iterable, **kwarg)
:noindex: :noindex:
Create a new dictionary. The :class:`dict` object is the dictionary class. Create a new dictionary. The :class:`dict` object is the dictionary class.
@ -420,7 +420,7 @@ are always available. They are listed here in alphabetical order.
.. function:: dir() .. function:: dir()
dir(object, /) dir(object)
Without arguments, return the list of names in the current local scope. With an Without arguments, return the list of names in the current local scope. With an
argument, attempt to return a list of valid attributes for that object. argument, attempt to return a list of valid attributes for that object.
@ -476,7 +476,7 @@ are always available. They are listed here in alphabetical order.
class. class.
.. function:: divmod(a, b, /) .. function:: divmod(a, b)
Take two (non-complex) numbers as arguments and return a pair of numbers Take two (non-complex) numbers as arguments and return a pair of numbers
consisting of their quotient and remainder when using integer division. With consisting of their quotient and remainder when using integer division. With
@ -619,7 +619,7 @@ are always available. They are listed here in alphabetical order.
Added the *closure* parameter. Added the *closure* parameter.
.. function:: filter(function, iterable, /) .. function:: filter(function, iterable)
Construct an iterator from those elements of *iterable* for which *function* Construct an iterator from those elements of *iterable* for which *function*
returns true. *iterable* may be either a sequence, a container which returns true. *iterable* may be either a sequence, a container which
@ -636,7 +636,7 @@ are always available. They are listed here in alphabetical order.
elements of *iterable* for which *function* returns false. elements of *iterable* for which *function* returns false.
.. class:: float(x=0.0, /) .. class:: float(x=0.0)
.. index:: .. index::
single: NaN single: NaN
@ -704,7 +704,7 @@ are always available. They are listed here in alphabetical order.
single: __format__ single: __format__
single: string; format() (built-in function) single: string; format() (built-in function)
.. function:: format(value, format_spec="", /) .. function:: format(value, format_spec="")
Convert a *value* to a "formatted" representation, as controlled by Convert a *value* to a "formatted" representation, as controlled by
*format_spec*. The interpretation of *format_spec* will depend on the type *format_spec*. The interpretation of *format_spec* will depend on the type
@ -727,7 +727,7 @@ are always available. They are listed here in alphabetical order.
.. _func-frozenset: .. _func-frozenset:
.. class:: frozenset(iterable=set(), /) .. class:: frozenset(iterable=set())
:noindex: :noindex:
Return a new :class:`frozenset` object, optionally with elements taken from Return a new :class:`frozenset` object, optionally with elements taken from
@ -739,8 +739,8 @@ are always available. They are listed here in alphabetical order.
module. module.
.. function:: getattr(object, name, /) .. function:: getattr(object, name)
getattr(object, name, default, /) getattr(object, name, default)
Return the value of the named attribute of *object*. *name* must be a string. Return the value of the named attribute of *object*. *name* must be a string.
If the string is the name of one of the object's attributes, the result is the If the string is the name of one of the object's attributes, the result is the
@ -764,7 +764,7 @@ are always available. They are listed here in alphabetical order.
regardless of where the function is called. regardless of where the function is called.
.. function:: hasattr(object, name, /) .. function:: hasattr(object, name)
The arguments are an object and a string. The result is ``True`` if the The arguments are an object and a string. The result is ``True`` if the
string is the name of one of the object's attributes, ``False`` if not. (This string is the name of one of the object's attributes, ``False`` if not. (This
@ -772,7 +772,7 @@ are always available. They are listed here in alphabetical order.
raises an :exc:`AttributeError` or not.) raises an :exc:`AttributeError` or not.)
.. function:: hash(object, /) .. function:: hash(object)
Return the hash value of the object (if it has one). Hash values are Return the hash value of the object (if it has one). Hash values are
integers. They are used to quickly compare dictionary keys during a integers. They are used to quickly compare dictionary keys during a
@ -807,7 +807,7 @@ are always available. They are listed here in alphabetical order.
signatures for callables are now more comprehensive and consistent. signatures for callables are now more comprehensive and consistent.
.. function:: hex(x, /) .. function:: hex(x)
Convert an integer number to a lowercase hexadecimal string prefixed with Convert an integer number to a lowercase hexadecimal string prefixed with
"0x". If *x* is not a Python :class:`int` object, it has to define an "0x". If *x* is not a Python :class:`int` object, it has to define an
@ -839,7 +839,7 @@ are always available. They are listed here in alphabetical order.
:meth:`float.hex` method. :meth:`float.hex` method.
.. function:: id(object, /) .. function:: id(object)
Return the "identity" of an object. This is an integer which Return the "identity" of an object. This is an integer which
is guaranteed to be unique and constant for this object during its lifetime. is guaranteed to be unique and constant for this object during its lifetime.
@ -852,7 +852,7 @@ are always available. They are listed here in alphabetical order.
.. function:: input() .. function:: input()
input(prompt, /) input(prompt)
If the *prompt* argument is present, it is written to standard output without If the *prompt* argument is present, it is written to standard output without
a trailing newline. The function then reads a line from input, converts it a trailing newline. The function then reads a line from input, converts it
@ -878,8 +878,8 @@ are always available. They are listed here in alphabetical order.
with the result after successfully reading input. with the result after successfully reading input.
.. class:: int(x=0, /) .. class:: int(x=0)
int(x, /, base=10) int(x, base=10)
Return an integer object constructed from a number or string *x*, or return Return an integer object constructed from a number or string *x*, or return
``0`` if no arguments are given. If *x* defines :meth:`__int__`, ``0`` if no arguments are given. If *x* defines :meth:`__int__`,
@ -930,7 +930,7 @@ are always available. They are listed here in alphabetical order.
See the :ref:`integer string conversion length limitation See the :ref:`integer string conversion length limitation
<int_max_str_digits>` documentation. <int_max_str_digits>` documentation.
.. function:: isinstance(object, classinfo, /) .. function:: isinstance(object, classinfo)
Return ``True`` if the *object* argument is an instance of the *classinfo* Return ``True`` if the *object* argument is an instance of the *classinfo*
argument, or of a (direct, indirect, or :term:`virtual <abstract base argument, or of a (direct, indirect, or :term:`virtual <abstract base
@ -947,7 +947,7 @@ are always available. They are listed here in alphabetical order.
*classinfo* can be a :ref:`types-union`. *classinfo* can be a :ref:`types-union`.
.. function:: issubclass(class, classinfo, /) .. function:: issubclass(class, classinfo)
Return ``True`` if *class* is a subclass (direct, indirect, or :term:`virtual Return ``True`` if *class* is a subclass (direct, indirect, or :term:`virtual
<abstract base class>`) of *classinfo*. A <abstract base class>`) of *classinfo*. A
@ -961,8 +961,8 @@ are always available. They are listed here in alphabetical order.
*classinfo* can be a :ref:`types-union`. *classinfo* can be a :ref:`types-union`.
.. function:: iter(object, /) .. function:: iter(object)
iter(object, sentinel, /) iter(object, sentinel)
Return an :term:`iterator` object. The first argument is interpreted very Return an :term:`iterator` object. The first argument is interpreted very
differently depending on the presence of the second argument. Without a differently depending on the presence of the second argument. Without a
@ -989,7 +989,7 @@ are always available. They are listed here in alphabetical order.
process_block(block) process_block(block)
.. function:: len(s, /) .. function:: len(s)
Return the length (the number of items) of an object. The argument may be a Return the length (the number of items) of an object. The argument may be a
sequence (such as a string, bytes, tuple, list, or range) or a collection sequence (such as a string, bytes, tuple, list, or range) or a collection
@ -1003,7 +1003,7 @@ are always available. They are listed here in alphabetical order.
.. _func-list: .. _func-list:
.. class:: list() .. class:: list()
list(iterable, /) list(iterable)
:noindex: :noindex:
Rather than being a function, :class:`list` is actually a mutable Rather than being a function, :class:`list` is actually a mutable
@ -1021,7 +1021,7 @@ are always available. They are listed here in alphabetical order.
The contents of this dictionary should not be modified; changes may not The contents of this dictionary should not be modified; changes may not
affect the values of local and free variables used by the interpreter. affect the values of local and free variables used by the interpreter.
.. function:: map(function, iterable, /, *iterables) .. function:: map(function, iterable, *iterables)
Return an iterator that applies *function* to every item of *iterable*, Return an iterator that applies *function* to every item of *iterable*,
yielding the results. If additional *iterables* arguments are passed, yielding the results. If additional *iterables* arguments are passed,
@ -1031,9 +1031,9 @@ are always available. They are listed here in alphabetical order.
already arranged into argument tuples, see :func:`itertools.starmap`\. already arranged into argument tuples, see :func:`itertools.starmap`\.
.. function:: max(iterable, /, *, key=None) .. function:: max(iterable, *, key=None)
max(iterable, /, *, default, key=None) max(iterable, *, default, key=None)
max(arg1, arg2, /, *args, key=None) max(arg1, arg2, *args, key=None)
Return the largest item in an iterable or the largest of two or more Return the largest item in an iterable or the largest of two or more
arguments. arguments.
@ -1069,9 +1069,9 @@ are always available. They are listed here in alphabetical order.
:ref:`typememoryview` for more information. :ref:`typememoryview` for more information.
.. function:: min(iterable, /, *, key=None) .. function:: min(iterable, *, key=None)
min(iterable, /, *, default, key=None) min(iterable, *, default, key=None)
min(arg1, arg2, /, *args, key=None) min(arg1, arg2, *args, key=None)
Return the smallest item in an iterable or the smallest of two or more Return the smallest item in an iterable or the smallest of two or more
arguments. arguments.
@ -1099,8 +1099,8 @@ are always available. They are listed here in alphabetical order.
The *key* can be ``None``. The *key* can be ``None``.
.. function:: next(iterator, /) .. function:: next(iterator)
next(iterator, default, /) next(iterator, default)
Retrieve the next item from the :term:`iterator` by calling its Retrieve the next item from the :term:`iterator` by calling its
:meth:`~iterator.__next__` method. If *default* is given, it is returned :meth:`~iterator.__next__` method. If *default* is given, it is returned
@ -1119,7 +1119,7 @@ are always available. They are listed here in alphabetical order.
assign arbitrary attributes to an instance of the :class:`object` class. assign arbitrary attributes to an instance of the :class:`object` class.
.. function:: oct(x, /) .. function:: oct(x)
Convert an integer number to an octal string prefixed with "0o". The result Convert an integer number to an octal string prefixed with "0o". The result
is a valid Python expression. If *x* is not a Python :class:`int` object, it is a valid Python expression. If *x* is not a Python :class:`int` object, it
@ -1371,7 +1371,7 @@ are always available. They are listed here in alphabetical order.
.. versionchanged:: 3.11 .. versionchanged:: 3.11
The ``'U'`` mode has been removed. The ``'U'`` mode has been removed.
.. function:: ord(c, /) .. function:: ord(c)
Given a string representing one Unicode character, return an integer Given a string representing one Unicode character, return an integer
representing the Unicode code point of that character. For example, representing the Unicode code point of that character. For example,
@ -1522,15 +1522,15 @@ are always available. They are listed here in alphabetical order.
.. _func-range: .. _func-range:
.. class:: range(stop, /) .. class:: range(stop)
range(start, stop, step=1, /) range(start, stop, step=1)
:noindex: :noindex:
Rather than being a function, :class:`range` is actually an immutable Rather than being a function, :class:`range` is actually an immutable
sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`. sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`.
.. function:: repr(object, /) .. function:: repr(object)
Return a string containing a printable representation of an object. For many Return a string containing a printable representation of an object. For many
types, this function makes an attempt to return a string that would yield an types, this function makes an attempt to return a string that would yield an
@ -1543,7 +1543,7 @@ are always available. They are listed here in alphabetical order.
:exc:`RuntimeError`. :exc:`RuntimeError`.
.. function:: reversed(seq, /) .. function:: reversed(seq)
Return a reverse :term:`iterator`. *seq* must be an object which has Return a reverse :term:`iterator`. *seq* must be an object which has
a :meth:`__reversed__` method or supports the sequence protocol (the a :meth:`__reversed__` method or supports the sequence protocol (the
@ -1580,7 +1580,7 @@ are always available. They are listed here in alphabetical order.
.. _func-set: .. _func-set:
.. class:: set() .. class:: set()
set(iterable, /) set(iterable)
:noindex: :noindex:
Return a new :class:`set` object, optionally with elements taken from Return a new :class:`set` object, optionally with elements taken from
@ -1592,7 +1592,7 @@ are always available. They are listed here in alphabetical order.
module. module.
.. function:: setattr(object, name, value, /) .. function:: setattr(object, name, value)
This is the counterpart of :func:`getattr`. The arguments are an object, a This is the counterpart of :func:`getattr`. The arguments are an object, a
string, and an arbitrary value. The string may name an existing attribute or a string, and an arbitrary value. The string may name an existing attribute or a
@ -1614,8 +1614,8 @@ are always available. They are listed here in alphabetical order.
:func:`setattr`. :func:`setattr`.
.. class:: slice(stop, /) .. class:: slice(stop)
slice(start, stop, step=1, /) slice(start, stop, step=1)
Return a :term:`slice` object representing the set of indices specified by Return a :term:`slice` object representing the set of indices specified by
``range(start, stop, step)``. The *start* and *step* arguments default to ``range(start, stop, step)``. The *start* and *step* arguments default to
@ -1733,7 +1733,7 @@ are always available. They are listed here in alphabetical order.
The *start* parameter can be specified as a keyword argument. The *start* parameter can be specified as a keyword argument.
.. class:: super() .. class:: super()
super(type, object_or_type=None, /) super(type, object_or_type=None)
Return a proxy object that delegates method calls to a parent or sibling Return a proxy object that delegates method calls to a parent or sibling
class of *type*. This is useful for accessing inherited methods that have class of *type*. This is useful for accessing inherited methods that have
@ -1804,15 +1804,15 @@ are always available. They are listed here in alphabetical order.
.. _func-tuple: .. _func-tuple:
.. class:: tuple() .. class:: tuple()
tuple(iterable, /) tuple(iterable)
:noindex: :noindex:
Rather than being a function, :class:`tuple` is actually an immutable Rather than being a function, :class:`tuple` is actually an immutable
sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`. sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`.
.. class:: type(object, /) .. class:: type(object)
type(name, bases, dict, /, **kwds) type(name, bases, dict, **kwds)
.. index:: object: type .. index:: object: type
@ -1853,7 +1853,7 @@ are always available. They are listed here in alphabetical order.
longer use the one-argument form to get the type of an object. longer use the one-argument form to get the type of an object.
.. function:: vars() .. function:: vars()
vars(object, /) vars(object)
Return the :attr:`~object.__dict__` attribute for a module, class, instance, Return the :attr:`~object.__dict__` attribute for a module, class, instance,
or any other object with a :attr:`~object.__dict__` attribute. or any other object with a :attr:`~object.__dict__` attribute.