We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 888d101 commit 666a2a8Copy full SHA for 666a2a8
Doc/library/functools.rst
@@ -679,7 +679,11 @@ The :mod:`functools` module defines the following functions:
679
decorator. When defining a method using ``@singledispatchmethod``, note
680
that the dispatch happens on the type of the first non-*self* or non-*cls*
681
argument::
682
-
+ .. note::
683
+ ``singledispatchmethod`` dispatches the first argument during call
684
+ time irrespective of whether the method is bound or unbound, as a result,
685
+ ``x.f(a) != C.f(x, a)``.The behavior is intentional and required to support correct dispatch for
686
+ ``staticmethod`` and ``classmethod``.
687
class Negator:
688
@singledispatchmethod
689
def neg(self, arg):
0 commit comments