https://github.com/python/cpython/commit/8f7188847fcd2e9ba1abc85a554933bef0e59f92 commit: 8f7188847fcd2e9ba1abc85a554933bef0e59f92 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2025-11-18T11:38:38Z summary:
[3.13] gh-140873: Fix the singledispatchmethod documentation (GH-141523) (GH-141710) It does not support non-descriptor callables yet. (cherry picked from commit d89eb2f984032836e268d1b9af9c2400cddc474e) Co-authored-by: Serhiy Storchaka <[email protected]> files: M Doc/library/functools.rst M Lib/functools.py diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 18c83b1fda17b3..5dc09d0472d4ec 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -620,7 +620,7 @@ The :mod:`functools` module defines the following functions: dispatch>` :term:`generic function`. To define a generic method, decorate it with the ``@singledispatchmethod`` - decorator. When defining a function using ``@singledispatchmethod``, note + decorator. When defining a method using ``@singledispatchmethod``, note that the dispatch happens on the type of the first non-*self* or non-*cls* argument:: diff --git a/Lib/functools.py b/Lib/functools.py index 4c1175b815d6ec..0dee17e5bcde3d 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -947,8 +947,7 @@ def wrapper(*args, **kw): class singledispatchmethod: """Single-dispatch generic method descriptor. - Supports wrapping existing descriptors and handles non-descriptor - callables as instance methods. + Supports wrapping existing descriptors. """ def __init__(self, func): _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
