FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-143535: Document dispatch behavior of singledispatchmethod by priyanshu2282-cyber · Pull Request #143592 · python/cpython · GitHub

Repository navigation

5 changes: 5 additions & 0 deletions Doc/library/functools.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,11 @@ The :mod:`functools` module defines the following functions:
The same pattern can be used for other similar decorators:
:deco:`staticmethod`, :deco:`~abc.abstractmethod`, and others.

For every method decorated with ``@singledispatchmethod`` in a class, the value
dispatched on by that method is *always* the first argument passed for the call.
Therefore, dispatching to regular methods can only be sensibly performed by
calling such a method from instances of the class, and not from the class object.

.. versionadded:: 3.8

.. versionchanged:: 3.15
Expand Down
Loading

Back | FazBrowse Home | New Git URL