From d89eb2f984032836e268d1b9af9c2400cddc474e Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 18 Nov 2025 13:16:39 +0200 Subject: [PATCH] [3.14] gh-140873: Fix the singledispatchmethod documentation (GH-141523) It does not support non-descriptor callables yet. --- Doc/library/functools.rst | 2 +- Lib/functools.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 8028cfc34d7e..01db54bbb86c 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 7f0eac3f6502..df4660eef3fe 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -995,8 +995,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): -- 2.47.3