Skip to content

[3.7] bpo-38738: Fix formatting of True and False. (GH-17083) #17128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/library/asyncio-stream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ StreamWriter

.. method:: can_write_eof()

Return *True* if the underlying transport supports
the :meth:`write_eof` method, *False* otherwise.
Return ``True`` if the underlying transport supports
the :meth:`write_eof` method, ``False`` otherwise.

.. method:: write_eof()

Expand Down
6 changes: 3 additions & 3 deletions Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Module-level decorators, classes, and functions
method of the superclass will be used (if the superclass is
:class:`object`, this means it will fall back to id-based hashing).

- ``frozen``: If true (the default is False), assigning to fields will
- ``frozen``: If true (the default is ``False``), assigning to fields will
generate an exception. This emulates read-only frozen instances. If
:meth:`__setattr__` or :meth:`__delattr__` is defined in the class, then
:exc:`TypeError` is raised. See the discussion below.
Expand Down Expand Up @@ -387,8 +387,8 @@ Module-level decorators, classes, and functions

.. function:: is_dataclass(class_or_instance)

Returns True if its parameter is a dataclass or an instance of one,
otherwise returns False.
Return ``True`` if its parameter is a dataclass or an instance of one,
otherwise return ``False``.

If you need to know if a class is an instance of a dataclass (and
not a dataclass itself), then add a further check for ``not
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/difflib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,14 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.

.. function:: IS_LINE_JUNK(line)

Return true for ignorable lines. The line *line* is ignorable if *line* is
Return ``True`` for ignorable lines. The line *line* is ignorable if *line* is
blank or contains a single ``'#'``, otherwise it is not ignorable. Used as a
default for parameter *linejunk* in :func:`ndiff` in older versions.


.. function:: IS_CHARACTER_JUNK(ch)

Return true for ignorable characters. The character *ch* is ignorable if *ch*
Return ``True`` for ignorable characters. The character *ch* is ignorable if *ch*
is a space or tab, otherwise it is not ignorable. Used as a default for
parameter *charjunk* in :func:`ndiff`.

Expand All @@ -366,7 +366,7 @@ The :class:`SequenceMatcher` class has this constructor:
Optional argument *isjunk* must be ``None`` (the default) or a one-argument
function that takes a sequence element and returns true if and only if the
element is "junk" and should be ignored. Passing ``None`` for *isjunk* is
equivalent to passing ``lambda x: 0``; in other words, no elements are ignored.
equivalent to passing ``lambda x: False``; in other words, no elements are ignored.
For example, pass::

lambda x: x in " \t"
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/doctest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ OutputChecker objects

A class used to check the whether the actual output from a doctest example
matches the expected output. :class:`OutputChecker` defines two methods:
:meth:`check_output`, which compares a given pair of outputs, and returns true
:meth:`check_output`, which compares a given pair of outputs, and returns ``True``
if they match; and :meth:`output_difference`, which returns a string describing
the differences between two outputs.

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/email.compat32-message.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Here are the methods of the :class:`Message` class:

.. method:: __contains__(name)

Return true if the message object has a field named *name*. Matching is
Return ``True`` if the message object has a field named *name*. Matching is
done case-insensitively and *name* should not include the trailing colon.
Used for the ``in`` operator, e.g.::

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/email.errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ All defect classes are subclassed from :class:`email.errors.MessageDefect`.
* :class:`MultipartInvariantViolationDefect` -- A message claimed to be a
:mimetype:`multipart`, but no subparts were found. Note that when a message
has this defect, its :meth:`~email.message.Message.is_multipart` method may
return false even though its content type claims to be :mimetype:`multipart`.
return ``False`` even though its content type claims to be :mimetype:`multipart`.

* :class:`InvalidBase64PaddingDefect` -- When decoding a block of base64
encoded bytes, the padding was not correct. Enough padding is added to
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/email.message.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ message objects.

.. method:: __contains__(name)

Return true if the message object has a field named *name*. Matching is
Return ``True`` if the message object has a field named *name*. Matching is
done without regard to case and *name* does not include the trailing
colon. Used for the ``in`` operator. For example::

Expand Down
8 changes: 4 additions & 4 deletions Doc/library/fileinput.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ if there is no active state, :exc:`RuntimeError` is raised.

.. function:: isfirstline()

Returns true if the line just read is the first line of its file, otherwise
returns false.
Return ``True`` if the line just read is the first line of its file, otherwise
return ``False``.


.. function:: isstdin()

Returns true if the last line was read from ``sys.stdin``, otherwise returns
false.
Return ``True`` if the last line was read from ``sys.stdin``, otherwise return
``False``.


.. function:: nextfile()
Expand Down
12 changes: 6 additions & 6 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ are always available. They are listed here in alphabetical order.
.. function:: callable(object)

Return :const:`True` if the *object* argument appears callable,
:const:`False` if not. If this returns true, it is still possible that a
call fails, but if it is false, calling *object* will never succeed.
:const:`False` if not. If this returns ``True``, it is still possible that a
call fails, but if it is ``False``, calling *object* will never succeed.
Note that classes are callable (calling a class returns a new instance);
instances are callable if their class has a :meth:`__call__` method.

Expand Down Expand Up @@ -777,19 +777,19 @@ are always available. They are listed here in alphabetical order.

.. function:: isinstance(object, classinfo)

Return true if the *object* argument is an instance of the *classinfo*
Return ``True`` if the *object* argument is an instance of the *classinfo*
argument, or of a (direct, indirect or :term:`virtual <abstract base
class>`) subclass thereof. If *object* is not
an object of the given type, the function always returns false.
an object of the given type, the function always returns ``False``.
If *classinfo* is a tuple of type objects (or recursively, other such
tuples), return true if *object* is an instance of any of the types.
tuples), return ``True`` if *object* is an instance of any of the types.
If *classinfo* is not a type or tuple of types and such tuples,
a :exc:`TypeError` exception is raised.


.. function:: issubclass(class, classinfo)

Return true if *class* is a subclass (direct, indirect or :term:`virtual
Return ``True`` if *class* is a subclass (direct, indirect or :term:`virtual
<abstract base class>`) of *classinfo*. A
class is considered a subclass of itself. *classinfo* may be a tuple of class
objects, in which case every entry in *classinfo* will be checked. In any other
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/gc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The :mod:`gc` module provides the following functions:

.. function:: isenabled()

Returns true if automatic collection is enabled.
Return ``True`` if automatic collection is enabled.


.. function:: collect(generation=2)
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/http.cookiejar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ methods:

.. method:: CookiePolicy.domain_return_ok(domain, request)

Return false if cookies should not be returned, given cookie domain.
Return ``False`` if cookies should not be returned, given cookie domain.

This method is an optimization. It removes the need for checking every cookie
with a particular domain (which might involve reading many files). Returning
Expand All @@ -393,7 +393,7 @@ methods:

.. method:: CookiePolicy.path_return_ok(path, request)

Return false if cookies should not be returned, given cookie path.
Return ``False`` if cookies should not be returned, given cookie path.

See the documentation for :meth:`domain_return_ok`.

Expand Down Expand Up @@ -702,7 +702,7 @@ accessed using the following methods:

.. method:: Cookie.has_nonstandard_attr(name)

Return true if cookie has the named cookie-attribute.
Return ``True`` if cookie has the named cookie-attribute.


.. method:: Cookie.get_nonstandard_attr(name, default=None)
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/importlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ find and load modules.

.. method:: is_package(fullname)

Return true if :attr:`path` appears to be for a package.
Return ``True`` if :attr:`path` appears to be for a package.

.. method:: path_stats(path)

Expand Down
44 changes: 22 additions & 22 deletions Doc/library/inspect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,55 +273,55 @@ attributes:

.. 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.


.. 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


.. 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


.. 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::
Expand All @@ -340,7 +340,7 @@ attributes:

.. 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():
Expand All @@ -354,44 +354,44 @@ attributes:

.. 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.

Expand All @@ -402,14 +402,14 @@ attributes:
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
Expand All @@ -422,7 +422,7 @@ attributes:

.. function:: isgetsetdescriptor(object)

Return true if the object is a getset descriptor.
Return ``True`` if the object is a getset descriptor.

.. impl-detail::

Expand All @@ -433,7 +433,7 @@ attributes:

.. function:: ismemberdescriptor(object)

Return true if the object is a member descriptor.
Return ``True`` if the object is a member descriptor.

.. impl-detail::

Expand Down
4 changes: 2 additions & 2 deletions Doc/library/ipaddress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ dictionaries.

.. method:: subnet_of(other)

Returns *True* if this network is a subnet of *other*.
Return ``True`` if this network is a subnet of *other*.

>>> a = ip_network('192.168.1.0/24')
>>> b = ip_network('192.168.1.128/30')
Expand All @@ -568,7 +568,7 @@ dictionaries.

.. method:: supernet_of(other)

Returns *True* if this network is a supernet of *other*.
Return ``True`` if this network is a supernet of *other*.

>>> a = ip_network('192.168.1.0/24')
>>> b = ip_network('192.168.1.128/30')
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/keyword.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This module allows a Python program to determine if a string is a keyword.

.. function:: iskeyword(s)

Return true if *s* is a Python keyword.
Return ``True`` if *s* is a Python keyword.


.. data:: kwlist
Expand Down
Loading