Skip to content

Commit 8864e6d

Browse files
authored
Update functools.rst
1 parent a07190e commit 8864e6d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Doc/library/functools.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ The :mod:`functools` module defines the following functions:
491491

492492
.. decorator:: singledispatch
493493

494-
.. method:: register()
494+
.. method:: singledispatch.register()
495495
:no-typesetting:
496496

497497
Transform a function into a :term:`single-dispatch <single
@@ -508,7 +508,7 @@ The :mod:`functools` module defines the following functions:
508508
... print("Let me just say,", end=" ")
509509
... print(arg)
510510

511-
To add overloaded implementations to the function, use the :func:`register`
511+
To add overloaded implementations to the function, use the :func:`!register`
512512
attribute of the generic function, which can be used as a decorator. For
513513
functions annotated with types, the decorator will infer the type of the
514514
first argument automatically::
@@ -574,14 +574,14 @@ The :mod:`functools` module defines the following functions:
574574
runtime impact.
575575

576576
To enable registering :term:`lambdas<lambda>` and pre-existing functions,
577-
the :func:`register` attribute can also be used in a functional form::
577+
the :func:`!register` attribute can also be used in a functional form::
578578

579579
>>> def nothing(arg, verbose=False):
580580
... print("Nothing.")
581581
...
582582
>>> fun.register(type(None), nothing)
583583

584-
The :func:`register` attribute returns the undecorated function. This
584+
The :func:`!register` attribute returns the undecorated function. This
585585
enables decorator stacking, :mod:`pickling<pickle>`, and the creation
586586
of unit tests for each variant independently::
587587

@@ -659,10 +659,10 @@ The :mod:`functools` module defines the following functions:
659659
.. versionadded:: 3.4
660660

661661
.. versionchanged:: 3.7
662-
The :func:`register` attribute now supports using type annotations.
662+
The :func:`!register` attribute now supports using type annotations.
663663

664664
.. versionchanged:: 3.11
665-
The :func:`register` attribute now supports
665+
The :func:`!register` attribute now supports
666666
:class:`typing.Union` as a type annotation.
667667

668668

0 commit comments

Comments
 (0)