https://github.com/python/cpython/commit/d89eb2f984032836e268d1b9af9c2400cddc474e
commit: d89eb2f984032836e268d1b9af9c2400cddc474e
branch: 3.14
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2025-11-18T13:16:39+02:00
summary:

[3.14] gh-140873: Fix the singledispatchmethod documentation (GH-141523)

It does not support non-descriptor callables yet.

files:
M Doc/library/functools.rst
M Lib/functools.py

diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 8028cfc34d7e26..01db54bbb86c4f 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -672,7 +672,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 7f0eac3f650209..df4660eef3fe82 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -995,8 +995,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]

Reply via email to