summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorHakan Çelik <hakancelik96@outlook.com>2022-02-16 12:46:20 (GMT)
committerGitHub <noreply@github.com>2022-02-16 12:46:20 (GMT)
commit562c13f5734d406b2283cfca673611f4b496fdc7 (patch)
tree143bae4befe45ab85669c278feb93202867ecb2c /Doc
parent3954fcb83fe471911ff01c0410a71d184d9984e7 (diff)
downloadcpython-562c13f5734d406b2283cfca673611f4b496fdc7.zip
cpython-562c13f5734d406b2283cfca673611f4b496fdc7.tar.gz
cpython-562c13f5734d406b2283cfca673611f4b496fdc7.tar.bz2
bpo-29418: Implement inspect.ismethodwrapper and fix inspect.isroutine for cases where methodwrapper is given (GH-19261)
Automerge-Triggered-By: GH:isidentical
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/inspect.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 711f510..7a6dc9c 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -429,6 +429,14 @@ attributes:
Return ``True`` if the object is a built-in function or a bound built-in method.
+.. function:: ismethodwrapper(object)
+
+ Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`.
+
+ These are instances of :class:`~types.MethodWrapperType`, such as :meth:`~object().__str__`,
+ :meth:`~object().__eq__` and :meth:`~object().__repr__`
+
+
.. function:: isroutine(object)
Return ``True`` if the object is a user-defined or built-in function or method.