]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-140873: Fix the singledispatchmethod documentation (GH-141523) (GH-141710)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 18 Nov 2025 11:38:38 +0000 (12:38 +0100)
committerGitHub <noreply@github.com>
Tue, 18 Nov 2025 11:38:38 +0000 (11:38 +0000)
It does not support non-descriptor callables yet.
(cherry picked from commit d89eb2f984032836e268d1b9af9c2400cddc474e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/library/functools.rst
Lib/functools.py

index 18c83b1fda17b38e05705ac7a0b812f31fdd6351..5dc09d0472d4ec06475a26692c9ab6c8627d83b7 100644 (file)
@@ -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::
 
index 4c1175b815d6ecd7dc0e1ca9d1d302d183781261..0dee17e5bcde3d99082c4dc3d40ba6af1bad4601 100644 (file)
@@ -947,8 +947,7 @@ def singledispatch(func):
 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):