Skip to content

Commit 57e6d20

Browse files
Update Doc/library/functools.rst
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
1 parent 2834c45 commit 57e6d20

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Doc/library/functools.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,12 +718,10 @@ The :mod:`functools` module defines the following functions:
718718
The same pattern can be used for other similar decorators:
719719
:deco:`staticmethod`, :deco:`~abc.abstractmethod`, and others.
720720

721-
``singledispatchmethod`` always dispatches on the first argument passed at call
722-
time, irrespective of whether the method is bound or unbound. As a result,
723-
calling the method through an instance or through the class may result in
724-
different dispatch behavior. This behavior is required to support correct
725-
dispatch when used with ``staticmethod`` and ``classmethod``.
726-
721+
For every ``singledispatchmethod`` method defined in a class, the value
722+
dispatched on by that method is *always* the first argument passed for the call.
723+
Therefore, dispatching to regular methods can only be sensibly performed by
724+
calling such a method from instances of the class, and not from the class object.
727725
.. versionadded:: 3.8
728726

729727
.. versionchanged:: 3.15

0 commit comments

Comments
 (0)