bpo-38738: Fix formatting of True and False. (GH-17083)
* "Return true/false" is replaced with "Return ``True``/``False``"
if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 2a71201..f6156a0 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -277,55 +277,55 @@
.. function:: ismodule(object)
- Return true if the object is a module.
+ Return ``True`` if the object is a module.
.. function:: isclass(object)
- Return true if the object is a class, whether built-in or created in Python
+ Return ``True`` if the object is a class, whether built-in or created in Python
code.
.. function:: ismethod(object)
- Return true if the object is a bound method written in Python.
+ Return ``True`` if the object is a bound method written in Python.
.. function:: isfunction(object)
- Return true if the object is a Python function, which includes functions
+ Return ``True`` if the object is a Python function, which includes functions
created by a :term:`lambda` expression.
.. function:: isgeneratorfunction(object)
- Return true if the object is a Python generator function.
+ Return ``True`` if the object is a Python generator function.
.. versionchanged:: 3.8
- Functions wrapped in :func:`functools.partial` now return true if the
+ Functions wrapped in :func:`functools.partial` now return ``True`` if the
wrapped function is a Python generator function.
.. function:: isgenerator(object)
- Return true if the object is a generator.
+ Return ``True`` if the object is a generator.
.. function:: iscoroutinefunction(object)
- Return true if the object is a :term:`coroutine function`
+ Return ``True`` if the object is a :term:`coroutine function`
(a function defined with an :keyword:`async def` syntax).
.. versionadded:: 3.5
.. versionchanged:: 3.8
- Functions wrapped in :func:`functools.partial` now return true if the
+ Functions wrapped in :func:`functools.partial` now return ``True`` if the
wrapped function is a :term:`coroutine function`.
.. function:: iscoroutine(object)
- Return true if the object is a :term:`coroutine` created by an
+ Return ``True`` if the object is a :term:`coroutine` created by an
:keyword:`async def` function.
.. versionadded:: 3.5
@@ -333,7 +333,7 @@
.. function:: isawaitable(object)
- Return true if the object can be used in :keyword:`await` expression.
+ Return ``True`` if the object can be used in :keyword:`await` expression.
Can also be used to distinguish generator-based coroutines from regular
generators::
@@ -352,7 +352,7 @@
.. function:: isasyncgenfunction(object)
- Return true if the object is an :term:`asynchronous generator` function,
+ Return ``True`` if the object is an :term:`asynchronous generator` function,
for example::
>>> async def agen():
@@ -364,50 +364,50 @@
.. versionadded:: 3.6
.. versionchanged:: 3.8
- Functions wrapped in :func:`functools.partial` now return true if the
+ Functions wrapped in :func:`functools.partial` now return ``True`` if the
wrapped function is a :term:`asynchronous generator` function.
.. function:: isasyncgen(object)
- Return true if the object is an :term:`asynchronous generator iterator`
+ Return ``True`` if the object is an :term:`asynchronous generator iterator`
created by an :term:`asynchronous generator` function.
.. versionadded:: 3.6
.. function:: istraceback(object)
- Return true if the object is a traceback.
+ Return ``True`` if the object is a traceback.
.. function:: isframe(object)
- Return true if the object is a frame.
+ Return ``True`` if the object is a frame.
.. function:: iscode(object)
- Return true if the object is a code.
+ Return ``True`` if the object is a code.
.. function:: isbuiltin(object)
- Return true if the object is a built-in function or a bound built-in method.
+ Return ``True`` if the object is a built-in function or a bound built-in method.
.. 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)
- Return true if the object is an abstract base class.
+ Return ``True`` if the object is an abstract base class.
.. function:: ismethoddescriptor(object)
- Return true if the object is a method descriptor, but not if
+ Return ``True`` if the object is a method descriptor, but not if
:func:`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin`
are true.
@@ -418,14 +418,14 @@
sensible, and :attr:`__doc__` often is.
Methods implemented via descriptors that also pass one of the other tests
- return false from the :func:`ismethoddescriptor` test, simply because the
+ return ``False`` from the :func:`ismethoddescriptor` test, simply because the
other tests promise more -- you can, e.g., count on having the
:attr:`__func__` attribute (etc) when an object passes :func:`ismethod`.
.. function:: isdatadescriptor(object)
- Return true if the object is a data descriptor.
+ Return ``True`` if the object is a data descriptor.
Data descriptors have both a :attr:`~object.__get__` and a :attr:`~object.__set__` method.
Examples are properties (defined in Python), getsets, and members. The
@@ -438,7 +438,7 @@
.. function:: isgetsetdescriptor(object)
- Return true if the object is a getset descriptor.
+ Return ``True`` if the object is a getset descriptor.
.. impl-detail::
@@ -449,7 +449,7 @@
.. function:: ismemberdescriptor(object)
- Return true if the object is a member descriptor.
+ Return ``True`` if the object is a member descriptor.
.. impl-detail::