From a0ff16990e4f920c5e76c1525c7d13cd61586682 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 13 Nov 2025 19:54:29 +0200 Subject: [PATCH] gh-140873: Fix the singledispatchmethod documentation 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 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):