From 6ef0f656da9a9e8ec2b0cd3002551e961cf176aa Mon Sep 17 00:00:00 2001 From: CHINMAY <89741289+Das-Chinmay@users.noreply.github.com> Date: Thu, 26 Mar 2026 21:42:31 -0700 Subject: [PATCH] gh-72088: clarify inspect.ismethod returns False for class-level access Accessing a method through the class returns a plain function, not a bound method, so ismethod() returns False in that case. Add a note and a cross-reference to the 'instance methods' section of the data model reference to explain this. --- Doc/library/inspect.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index ff893a4513926a..5b47d80de9c20b 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -425,6 +425,11 @@ attributes (see :ref:`import-mod-attrs` for module attributes): Return ``True`` if the object is a bound method written in Python. + Note that accessing a method through the class (rather than an instance) + returns a plain :term:`function`, not a bound method, so :func:`ismethod` + will return ``False`` in that case. See :ref:`instance-methods` in the + language reference for details. + .. function:: ispackage(object)