Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39cadc3

Browse files
committed
#4968: updates to inspect.is* function docs.
1 parent d0b0e1d commit 39cadc3

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

Doc/library/inspect.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,19 @@ attributes:
204204

205205
.. function:: isclass(object)
206206

207-
Return true if the object is a class.
207+
Return true if the object is a class, whether built-in or created in Python
208+
code.
208209

209210

210211
.. function:: ismethod(object)
211212

212-
Return true if the object is a method.
213+
Return true if the object is a bound method written in Python.
213214

214215

215216
.. function:: isfunction(object)
216217

217-
Return true if the object is a Python function or unnamed (:term:`lambda`)
218-
function.
218+
Return true if the object is a Python function, which includes functions
219+
created by a :term:`lambda` expression.
219220

220221

221222
.. function:: isgeneratorfunction(object)
@@ -245,22 +246,24 @@ attributes:
245246

246247
.. function:: isbuiltin(object)
247248

248-
Return true if the object is a built-in function.
249+
Return true if the object is a built-in function or a bound built-in method.
249250

250251

251252
.. function:: isroutine(object)
252253

253254
Return true if the object is a user-defined or built-in function or method.
254255

256+
255257
.. function:: isabstract(object)
256258

257259
Return true if the object is an abstract base class.
258260

259261

260262
.. function:: ismethoddescriptor(object)
261263

262-
Return true if the object is a method descriptor, but not if :func:`ismethod`
263-
or :func:`isclass` or :func:`isfunction` are true.
264+
Return true if the object is a method descriptor, but not if
265+
:func:`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin`
266+
are true.
264267

265268
This, for example, is true of ``int.__add__``. An object passing this test
266269
has a :attr:`__get__` attribute but not a :attr:`__set__` attribute, but

0 commit comments

Comments
 (0)