mirror of https://github.com/python/cpython.git
#4968: updates to inspect.is* function docs.
This commit is contained in:
parent
d0b0e1d869
commit
39cadc3ffe
|
@ -204,18 +204,19 @@ attributes:
|
||||||
|
|
||||||
.. function:: isclass(object)
|
.. function:: isclass(object)
|
||||||
|
|
||||||
Return true if the object is a class.
|
Return true if the object is a class, whether built-in or created in Python
|
||||||
|
code.
|
||||||
|
|
||||||
|
|
||||||
.. function:: ismethod(object)
|
.. function:: ismethod(object)
|
||||||
|
|
||||||
Return true if the object is a method.
|
Return true if the object is a bound method written in Python.
|
||||||
|
|
||||||
|
|
||||||
.. function:: isfunction(object)
|
.. function:: isfunction(object)
|
||||||
|
|
||||||
Return true if the object is a Python function or unnamed (:term:`lambda`)
|
Return true if the object is a Python function, which includes functions
|
||||||
function.
|
created by a :term:`lambda` expression.
|
||||||
|
|
||||||
|
|
||||||
.. function:: isgeneratorfunction(object)
|
.. function:: isgeneratorfunction(object)
|
||||||
|
@ -245,13 +246,14 @@ attributes:
|
||||||
|
|
||||||
.. function:: isbuiltin(object)
|
.. function:: isbuiltin(object)
|
||||||
|
|
||||||
Return true if the object is a built-in function.
|
Return true if the object is a built-in function or a bound built-in method.
|
||||||
|
|
||||||
|
|
||||||
.. function:: isroutine(object)
|
.. function:: isroutine(object)
|
||||||
|
|
||||||
Return true if the object is a user-defined or built-in function or method.
|
Return true if the object is a user-defined or built-in function or method.
|
||||||
|
|
||||||
|
|
||||||
.. function:: isabstract(object)
|
.. function:: isabstract(object)
|
||||||
|
|
||||||
Return true if the object is an abstract base class.
|
Return true if the object is an abstract base class.
|
||||||
|
@ -259,8 +261,9 @@ attributes:
|
||||||
|
|
||||||
.. function:: ismethoddescriptor(object)
|
.. function:: ismethoddescriptor(object)
|
||||||
|
|
||||||
Return true if the object is a method descriptor, but not if :func:`ismethod`
|
Return true if the object is a method descriptor, but not if
|
||||||
or :func:`isclass` or :func:`isfunction` are true.
|
:func:`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin`
|
||||||
|
are true.
|
||||||
|
|
||||||
This, for example, is true of ``int.__add__``. An object passing this test
|
This, for example, is true of ``int.__add__``. An object passing this test
|
||||||
has a :attr:`__get__` attribute but not a :attr:`__set__` attribute, but
|
has a :attr:`__get__` attribute but not a :attr:`__set__` attribute, but
|
||||||
|
|
Loading…
Reference in New Issue