From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 23 Oct 2018 06:16:42 +0000 (-0700) Subject: bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) X-Git-Tag: v3.7.2rc1~245 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc62c7223ed1ecd422e870cf7bfc23060444450a;p=thirdparty%2FPython%2Fcpython.git bpo-34748: link to :ref:`partial-objects` in functools.partial doc. (GH-9809) (cherry picked from commit 83a07652e0033f0d9994ae7634b91d6581c56b00) Co-authored-by: Andrei Petre --- diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 3413cd353ca9..8924593464f9 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -172,10 +172,11 @@ The :mod:`functools` module defines the following functions: .. function:: partial(func, *args, **keywords) - Return a new :class:`partial` object which when called will behave like *func* - called with the positional arguments *args* and keyword arguments *keywords*. If - more arguments are supplied to the call, they are appended to *args*. If - additional keyword arguments are supplied, they extend and override *keywords*. + Return a new :ref:`partial object` which when called + will behave like *func* called with the positional arguments *args* + and keyword arguments *keywords*. If more arguments are supplied to the + call, they are appended to *args*. If additional keyword arguments are + supplied, they extend and override *keywords*. Roughly equivalent to:: def partial(func, *args, **keywords): @@ -214,7 +215,7 @@ The :mod:`functools` module defines the following functions: :func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another instance of :class:`partialmethod`), calls to ``__get__`` are delegated to the underlying descriptor, and an appropriate - :class:`partial` object returned as the result. + :ref:`partial object` returned as the result. When *func* is a non-descriptor callable, an appropriate bound method is created dynamically. This behaves like a normal Python function when