File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -692,11 +692,6 @@ The :mod:`functools` module defines the following functions:
692692 @neg.register
693693 def _(self, arg: bool):
694694 return not arg
695- .. note ::
696- ``singledispatchmethod `` dispatches the first argument during call
697- time irrespective of whether the method is bound or unbound, as a result,
698- ``x.f(a) != C.f(x, a) ``.The behavior is intentional and required to support correct dispatch for
699- ``staticmethod `` and ``classmethod ``.
700695
701696 ``@singledispatchmethod `` supports nesting with other decorators such as
702697 :deco: `classmethod `. Note that to allow for
@@ -723,6 +718,12 @@ The :mod:`functools` module defines the following functions:
723718 The same pattern can be used for other similar decorators:
724719 :deco: `staticmethod `, :deco: `~abc.abstractmethod `, and others.
725720
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+
726727 .. versionadded :: 3.8
727728
728729 .. versionchanged :: 3.15
You can’t perform that action at this time.
0 commit comments