]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Format None, True, False and NotImplemented as literals (GH-118758)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 8 May 2024 19:35:16 +0000 (22:35 +0300)
committerGitHub <noreply@github.com>
Wed, 8 May 2024 19:35:16 +0000 (22:35 +0300)
39 files changed:
Doc/c-api/object.rst
Doc/library/_thread.rst
Doc/library/asyncio-eventloop.rst
Doc/library/asyncio-task.rst
Doc/library/bdb.rst
Doc/library/code.rst
Doc/library/compileall.rst
Doc/library/csv.rst
Doc/library/dataclasses.rst
Doc/library/functools.rst
Doc/library/gc.rst
Doc/library/gzip.rst
Doc/library/imaplib.rst
Doc/library/importlib.resources.abc.rst
Doc/library/logging.handlers.rst
Doc/library/math.rst
Doc/library/multiprocessing.rst
Doc/library/os.rst
Doc/library/pathlib.rst
Doc/library/pickle.rst
Doc/library/pyclbr.rst
Doc/library/statistics.rst
Doc/library/sys.rst
Doc/library/test.rst
Doc/library/tkinter.dnd.rst
Doc/library/tty.rst
Doc/library/typing.rst
Doc/library/urllib.request.rst
Doc/tutorial/datastructures.rst
Misc/NEWS.d/3.11.0a1.rst
Misc/NEWS.d/3.11.0a2.rst
Misc/NEWS.d/3.11.0b1.rst
Misc/NEWS.d/3.12.0a1.rst
Misc/NEWS.d/3.12.0a3.rst
Misc/NEWS.d/3.12.0a4.rst
Misc/NEWS.d/3.12.0b1.rst
Misc/NEWS.d/3.13.0a1.rst
Misc/NEWS.d/3.13.0a2.rst
Misc/NEWS.d/3.13.0a3.rst

index ba454db9117504277169590d6d339518e475f89c..8eeac3fc8a1e587c15fc1052b9d5d9587a0c027c 100644 (file)
@@ -65,7 +65,7 @@ Object Protocol
 
    Properly handle returning :c:data:`Py_NotImplemented` from within a C
    function (that is, create a new :term:`strong reference`
-   to NotImplemented and return it).
+   to :const:`NotImplemented` and return it).
 
 
 .. c:macro:: Py_PRINT_RAW
index 3842539ce405d9add15775544b0971893a7aace7..81f0cac947f60218e3e39b8571b0a5d32ba7a0e8 100644 (file)
@@ -169,14 +169,14 @@ Lock objects have the following methods:
    time can acquire a lock --- that's their reason for existence).
 
    If the *blocking* argument is present, the action depends on its
-   value: if it is False, the lock is only acquired if it can be acquired
-   immediately without waiting, while if it is True, the lock is acquired
+   value: if it is false, the lock is only acquired if it can be acquired
+   immediately without waiting, while if it is true, the lock is acquired
    unconditionally as above.
 
    If the floating-point *timeout* argument is present and positive, it
    specifies the maximum wait time in seconds before returning.  A negative
    *timeout* argument specifies an unbounded wait.  You cannot specify
-   a *timeout* if *blocking* is False.
+   a *timeout* if *blocking* is false.
 
    The return value is ``True`` if the lock is acquired successfully,
    ``False`` if not.
index d6ed817b13676fc17307a9088ec1619b00e75484..374e789e91e7907c1f7caa83125b2adf755d5364 100644 (file)
@@ -796,7 +796,7 @@ Creating network servers
    :class:`str`, :class:`bytes`, and :class:`~pathlib.Path` paths
    are supported.
 
-   If *cleanup_socket* is True then the Unix socket will automatically
+   If *cleanup_socket* is true then the Unix socket will automatically
    be removed from the filesystem when the server is closed, unless the
    socket has been replaced after the server has been created.
 
index 188649a2968df8c571760d3fa5dfd1fe7fc4bbc6..c5deac7e2748ae3e53b5148b70e2c8862e56afc9 100644 (file)
@@ -538,7 +538,7 @@ Running Tasks Concurrently
       #     [2, 6, 24]
 
    .. note::
-      If *return_exceptions* is False, cancelling gather() after it
+      If *return_exceptions* is false, cancelling gather() after it
       has been marked done won't cancel any submitted awaitables.
       For instance, gather can be marked done after propagating an
       exception to the caller, therefore, calling ``gather.cancel()``
index c873666f325fbcc4a215aa9b3960f3c8a058794b..85df7914a9a01441c69e98e24f914f93fbd133e5 100644 (file)
@@ -86,7 +86,7 @@ The :mod:`bdb` module also defines two classes:
 
    .. attribute:: temporary
 
-      True if a :class:`Breakpoint` at (file, line) is temporary.
+      ``True`` if a :class:`Breakpoint` at (file, line) is temporary.
 
    .. attribute:: cond
 
@@ -99,7 +99,7 @@ The :mod:`bdb` module also defines two classes:
 
    .. attribute:: enabled
 
-      True if :class:`Breakpoint` is enabled.
+      ``True`` if :class:`Breakpoint` is enabled.
 
    .. attribute:: bpbynumber
 
@@ -215,22 +215,22 @@ The :mod:`bdb` module also defines two classes:
 
    .. method:: is_skipped_line(module_name)
 
-      Return True if *module_name* matches any skip pattern.
+      Return ``True`` if *module_name* matches any skip pattern.
 
    .. method:: stop_here(frame)
 
-      Return True if *frame* is below the starting frame in the stack.
+      Return ``True`` if *frame* is below the starting frame in the stack.
 
    .. method:: break_here(frame)
 
-      Return True if there is an effective breakpoint for this line.
+      Return ``True`` if there is an effective breakpoint for this line.
 
       Check whether a line or function breakpoint exists and is in effect.  Delete temporary
       breakpoints based on information from :func:`effective`.
 
    .. method:: break_anywhere(frame)
 
-      Return True if any breakpoint exists for *frame*'s filename.
+      Return ``True`` if any breakpoint exists for *frame*'s filename.
 
    Derived classes should override these methods to gain control over debugger
    operation.
@@ -348,7 +348,7 @@ The :mod:`bdb` module also defines two classes:
 
    .. method:: get_break(filename, lineno)
 
-      Return True if there is a breakpoint for *lineno* in *filename*.
+      Return ``True`` if there is a breakpoint for *lineno* in *filename*.
 
    .. method:: get_breaks(filename, lineno)
 
@@ -412,7 +412,7 @@ Finally, the module defines the following functions:
 
 .. function:: checkfuncname(b, frame)
 
-   Return True if we should break here, depending on the way the
+   Return ``True`` if we should break here, depending on the way the
    :class:`Breakpoint` *b* was set.
 
    If it was set via line number, it checks if
@@ -431,14 +431,14 @@ Finally, the module defines the following functions:
    :attr:`bplist <bdb.Breakpoint.bplist>` for the
    (:attr:`file <bdb.Breakpoint.file>`, :attr:`line <bdb.Breakpoint.line>`)
    (which must exist) that is :attr:`enabled <bdb.Breakpoint.enabled>`, for
-   which :func:`checkfuncname` is True, and that has neither a False
+   which :func:`checkfuncname` is true, and that has neither a false
    :attr:`condition <bdb.Breakpoint.cond>` nor positive
    :attr:`ignore <bdb.Breakpoint.ignore>` count.  The *flag*, meaning that a
-   temporary breakpoint should be deleted, is False only when the
+   temporary breakpoint should be deleted, is ``False`` only when the
    :attr:`cond <bdb.Breakpoint.cond>` cannot be evaluated (in which case,
    :attr:`ignore <bdb.Breakpoint.ignore>` count is ignored).
 
-   If no such entry exists, then (None, None) is returned.
+   If no such entry exists, then ``(None, None)`` is returned.
 
 
 .. function:: set_trace()
index c297160e825c1acde90194b56a13d5c3e9d57ee2..8c3a3e8e95a11f4e31ecae1f9edf25dc2ab2d70a 100644 (file)
@@ -27,7 +27,7 @@ build applications which provide an interactive interpreter prompt.
 
    Closely emulate the behavior of the interactive Python interpreter. This class
    builds on :class:`InteractiveInterpreter` and adds prompting using the familiar
-   ``sys.ps1`` and ``sys.ps2``, and input buffering. If *local_exit* is True,
+   ``sys.ps1`` and ``sys.ps2``, and input buffering. If *local_exit* is true,
    ``exit()`` and ``quit()`` in the console will not raise :exc:`SystemExit`, but
    instead return to the calling code.
 
index 8375648e6dd2d3461429108b0f7f66dc16e67b9a..d9c0cb67a92aa75f3708a6133aaa37aa02e8b435 100644 (file)
@@ -226,7 +226,7 @@ Public functions
       The *invalidation_mode* parameter was added.
 
    .. versionchanged:: 3.7.2
-      The *invalidation_mode* parameter's default value is updated to None.
+      The *invalidation_mode* parameter's default value is updated to ``None``.
 
    .. versionchanged:: 3.8
       Setting *workers* to 0 now chooses the optimal number of cores.
@@ -289,7 +289,7 @@ Public functions
       The *invalidation_mode* parameter was added.
 
    .. versionchanged:: 3.7.2
-      The *invalidation_mode* parameter's default value is updated to None.
+      The *invalidation_mode* parameter's default value is updated to ``None``.
 
    .. versionchanged:: 3.9
       Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* arguments.
@@ -318,7 +318,7 @@ Public functions
       The *invalidation_mode* parameter was added.
 
    .. versionchanged:: 3.7.2
-      The *invalidation_mode* parameter's default value is updated to None.
+      The *invalidation_mode* parameter's default value is updated to ``None``.
 
 To force a recompile of all the :file:`.py` files in the :file:`Lib/`
 subdirectory and all its subdirectories::
index 3ed199750affab6e23e62a447042b128dc8eefc1..533cdf13974be612c54d43225c0d5694bf1b8e4b 100644 (file)
@@ -349,8 +349,8 @@ The :mod:`csv` module defines the following constants:
    ``None``.  This is similar to :data:`QUOTE_ALL`, except that if a
    field value is ``None`` an empty (unquoted) string is written.
 
-   Instructs :class:`reader` objects to interpret an empty (unquoted) field as None and
-   to otherwise behave as :data:`QUOTE_ALL`.
+   Instructs :class:`reader` objects to interpret an empty (unquoted) field
+   as ``None`` and to otherwise behave as :data:`QUOTE_ALL`.
 
    .. versionadded:: 3.12
 
index 7a8b83e1384e5f36ba75aec1c22ab5c0f557ba00..98459c1b6e10200d8f1fe6cd57fdb7254fe3f5d5 100644 (file)
@@ -278,7 +278,7 @@ Module contents
      generated equality and comparison methods (:meth:`~object.__eq__`,
      :meth:`~object.__gt__`, et al.).
 
-   - *metadata*: This can be a mapping or None. None is treated as
+   - *metadata*: This can be a mapping or ``None``. ``None`` is treated as
      an empty dict.  This value is wrapped in
      :func:`~types.MappingProxyType` to make it read-only, and exposed
      on the :class:`Field` object. It is not used at all by Data
index f3f2f1169f79869ae332dca91e6ee194c026553f..1f003b3a94fda27e88baf023a504f9f88e1417a2 100644 (file)
@@ -325,7 +325,7 @@ The :mod:`functools` module defines the following functions:
    .. versionadded:: 3.2
 
    .. versionchanged:: 3.4
-      Returning NotImplemented from the underlying comparison function for
+      Returning ``NotImplemented`` from the underlying comparison function for
       unrecognised types is now supported.
 
 .. function:: partial(func, /, *args, **keywords)
index 9e3f942904dc54efaeac8436027f862aa3a27983..790dfdfd00b196788ada6f8573ba3ae6f2654b7e 100644 (file)
@@ -69,7 +69,7 @@ The :mod:`gc` module provides the following functions:
 .. function:: get_objects(generation=None)
 
    Returns a list of all objects tracked by the collector, excluding the list
-   returned. If *generation* is not None, return only the objects tracked by
+   returned. If *generation* is not ``None``, return only the objects tracked by
    the collector that are in that generation.
 
    .. versionchanged:: 3.8
index c609d54b73883edb232a6189cf50dda3cdaa38e4..965da5981f6dbcc23aa353bedd9984fe37e2f4de 100644 (file)
@@ -102,7 +102,7 @@ The module defines the following items:
 
    The optional *mtime* argument is the timestamp requested by gzip. The time
    is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970.
-   If *mtime* is omitted or None, the current time is used. Use *mtime* = 0
+   If *mtime* is omitted or ``None``, the current time is used. Use *mtime* = 0
    to generate a compressed stream that does not depend on creation time.
 
    See below for the :attr:`mtime` attribute that is set when decompressing.
index 2418a3b6b719e764b560eae21a65c8c04c73e3e1..a2dad58b00b9fa1954d558833eb2a593aacc3014 100644 (file)
@@ -39,7 +39,7 @@ base class:
    initialized. If *host* is not specified, ``''`` (the local host) is used. If
    *port* is omitted, the standard IMAP4 port (143) is used. The optional *timeout*
    parameter specifies a timeout in seconds for the connection attempt.
-   If timeout is not given or is None, the global default socket timeout is used.
+   If timeout is not given or is ``None``, the global default socket timeout is used.
 
    The :class:`IMAP4` class supports the :keyword:`with` statement.  When used
    like this, the IMAP4 ``LOGOUT`` command is issued automatically when the
@@ -97,7 +97,7 @@ There's also a subclass for secure connections:
    best practices.
 
    The optional *timeout* parameter specifies a timeout in seconds for the
-   connection attempt. If timeout is not given or is None, the global default
+   connection attempt. If timeout is not given or is ``None``, the global default
    socket timeout is used.
 
    .. versionchanged:: 3.3
@@ -360,7 +360,7 @@ An :class:`IMAP4` instance has the following methods:
 
    Opens socket to *port* at *host*. The optional *timeout* parameter
    specifies a timeout in seconds for the connection attempt.
-   If timeout is not given or is None, the global default socket timeout
+   If timeout is not given or is ``None``, the global default socket timeout
    is used. Also note that if the *timeout* parameter is set to be zero,
    it will raise a :class:`ValueError` to reject creating a non-blocking socket.
    This method is implicitly called by the :class:`IMAP4` constructor.
index 7261eacea905f0a0e522ddf00c4526849ab7604b..5ea8044e1ec6caa4d1daeb4484980f67eb86f5d4 100644 (file)
 
     .. abstractmethod:: is_dir()
 
-       Return True if self is a directory.
+       Return ``True`` if self is a directory.
 
     .. abstractmethod:: is_file()
 
-       Return True if self is a file.
+       Return ``True`` if self is a file.
 
     .. abstractmethod:: joinpath(*pathsegments)
 
index 68a54c2ead25bc1351d8c3c474e1ec8bab66a214..5a081f9e7add996c094b7a1528097d61ca2bdc56 100644 (file)
@@ -66,7 +66,7 @@ and :meth:`flush` methods).
 
       :param stream: The stream that the handler should use.
 
-      :return: the old stream, if the stream was changed, or *None* if it wasn't.
+      :return: the old stream, if the stream was changed, or ``None`` if it wasn't.
 
       .. versionadded:: 3.7
 
index dc43874bf4eabdd50e8ece9f567cd6d4e0e25b36..316144992d683222a0c2252d6dab8b5e2384fd0a 100644 (file)
@@ -268,7 +268,7 @@ Number-theoretic and representation functions
    Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates
    to zero when ``k > n``.
 
-   If *k* is not specified or is None, then *k* defaults to *n*
+   If *k* is not specified or is ``None``, then *k* defaults to *n*
    and the function returns ``n!``.
 
    Raises :exc:`TypeError` if either of the arguments are not integers.
index ff42dcf5f5b2996d5ec5d122e3bdd19531a2d0f2..49762491bae5f46df2dfddcd146810cc9d86a2c8 100644 (file)
@@ -2483,9 +2483,9 @@ multiple connections at the same time.
    generally be omitted since it can usually be inferred from the format of
    *address*. (See :ref:`multiprocessing-address-formats`)
 
-   If *authkey* is given and not None, it should be a byte string and will be
+   If *authkey* is given and not ``None``, it should be a byte string and will be
    used as the secret key for an HMAC-based authentication challenge. No
-   authentication is done if *authkey* is None.
+   authentication is done if *authkey* is ``None``.
    :exc:`~multiprocessing.AuthenticationError` is raised if authentication fails.
    See :ref:`multiprocessing-auth-keys`.
 
@@ -2518,9 +2518,9 @@ multiple connections at the same time.
    to the :meth:`~socket.socket.listen` method of the socket once it has been
    bound.
 
-   If *authkey* is given and not None, it should be a byte string and will be
+   If *authkey* is given and not ``None``, it should be a byte string and will be
    used as the secret key for an HMAC-based authentication challenge. No
-   authentication is done if *authkey* is None.
+   authentication is done if *authkey* is ``None``.
    :exc:`~multiprocessing.AuthenticationError` is raised if authentication fails.
    See :ref:`multiprocessing-auth-keys`.
 
index eb558357705ad61dac357fc8a5bca225aaab01ca..b93b06d4e72afca794c63d9b5be9f7f329b356c0 100644 (file)
@@ -923,7 +923,7 @@ as internal buffering of data.
 
    Copy *count* bytes from file descriptor *src*, starting from offset
    *offset_src*, to file descriptor *dst*, starting from offset *offset_dst*.
-   If *offset_src* is None, then *src* is read from the current position;
+   If *offset_src* is ``None``, then *src* is read from the current position;
    respectively for *offset_dst*.
 
    In Linux kernel older than 5.3, the files pointed to by *src* and *dst*
@@ -1718,7 +1718,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
    Transfer *count* bytes from file descriptor *src*, starting from offset
    *offset_src*, to file descriptor *dst*, starting from offset *offset_dst*.
    At least one of the file descriptors must refer to a pipe. If *offset_src*
-   is None, then *src* is read from the current position; respectively for
+   is ``None``, then *src* is read from the current position; respectively for
    *offset_dst*. The offset associated to the file descriptor that refers to a
    pipe must be ``None``. The files pointed to by *src* and *dst* must reside in
    the same filesystem, otherwise an :exc:`OSError` is raised with
index 5bf021fbc43210ab875a07c5079bba35fe8fcae1..15e9eaa5190256da414def7e42a2579c20be68fb 100644 (file)
@@ -627,8 +627,8 @@ Pure paths provide the following methods and properties:
           raise ValueError(error_message.format(str(self), str(formatted)))
       ValueError: '/etc/passwd' is not in the subpath of '/usr' OR one path is relative and the other is absolute.
 
-   When *walk_up* is False (the default), the path must start with *other*.
-   When the argument is True, ``..`` entries may be added to form the
+   When *walk_up* is false (the default), the path must start with *other*.
+   When the argument is true, ``..`` entries may be added to form the
    relative path. In all other cases, such as the paths referencing
    different drives, :exc:`ValueError` is raised.::
 
index fe589cf5cc8950db5a48df7a469a337def54bb92..57fbe5b6ece6b6ccd25be590ff8fd79bb106b8a0 100644 (file)
@@ -314,16 +314,16 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
    map the new Python 3 names to the old module names used in Python 2, so
    that the pickle data stream is readable with Python 2.
 
-   If *buffer_callback* is None (the default), buffer views are
+   If *buffer_callback* is ``None`` (the default), buffer views are
    serialized into *file* as part of the pickle stream.
 
-   If *buffer_callback* is not None, then it can be called any number
+   If *buffer_callback* is not ``None``, then it can be called any number
    of times with a buffer view.  If the callback returns a false value
-   (such as None), the given buffer is :ref:`out-of-band <pickle-oob>`;
+   (such as ``None``), the given buffer is :ref:`out-of-band <pickle-oob>`;
    otherwise the buffer is serialized in-band, i.e. inside the pickle stream.
 
-   It is an error if *buffer_callback* is not None and *protocol* is
-   None or smaller than 5.
+   It is an error if *buffer_callback* is not ``None`` and *protocol* is
+   ``None`` or smaller than 5.
 
    .. versionchanged:: 3.8
       The *buffer_callback* argument was added.
@@ -420,12 +420,12 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
    instances of :class:`~datetime.datetime`, :class:`~datetime.date` and
    :class:`~datetime.time` pickled by Python 2.
 
-   If *buffers* is None (the default), then all data necessary for
+   If *buffers* is ``None`` (the default), then all data necessary for
    deserialization must be contained in the pickle stream.  This means
-   that the *buffer_callback* argument was None when a :class:`Pickler`
+   that the *buffer_callback* argument was ``None`` when a :class:`Pickler`
    was instantiated (or when :func:`dump` or :func:`dumps` was called).
 
-   If *buffers* is not None, it should be an iterable of buffer-enabled
+   If *buffers* is not ``None``, it should be an iterable of buffer-enabled
    objects that is consumed each time the pickle stream references
    an :ref:`out-of-band <pickle-oob>` buffer view.  Such buffers have been
    given in order to the *buffer_callback* of a Pickler object.
index da359004e6dd1f65fa2bf5698156b0aaf202873d..5efb11d89dd143d3a06fb633d5d807e6fff3710c 100644 (file)
@@ -142,7 +142,7 @@ Class Objects
 
    .. attribute:: parent
 
-      For top-level classes, None.  For nested classes, the parent.
+      For top-level classes, ``None``.  For nested classes, the parent.
 
       .. versionadded:: 3.7
 
index 7af8c5ae618dff530c789dd4f3d709da33c7dd12..8453135d2e164dc91082c656ef3f043a28c97ba7 100644 (file)
@@ -220,7 +220,7 @@ However, for reading convenience, most of the examples show sorted sequences.
 .. function:: harmonic_mean(data, weights=None)
 
    Return the harmonic mean of *data*, a sequence or iterable of
-   real-valued numbers.  If *weights* is omitted or *None*, then
+   real-valued numbers.  If *weights* is omitted or ``None``, then
    equal weighting is assumed.
 
    The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the
index e6d39522fc6da30ea839c9da8aef50b4d068084b..ed809d04167ffd9a218de08d3a5e4491d346c0fd 100644 (file)
@@ -1708,7 +1708,7 @@ always available.
    contain a tuple of (filename, line number, function name) tuples
    describing the traceback where the coroutine object was created,
    with the most recent call first. When disabled, ``cr_origin`` will
-   be None.
+   be ``None``.
 
    To enable, pass a *depth* value greater than zero; this sets the
    number of frames whose information will be captured. To disable,
index 0fff1a0ae3b563124ed62576f573f6f20f7326a6..2a61f0aaef2b4c9010d3004cdfd82d2d0e48a8a6 100644 (file)
@@ -324,7 +324,7 @@ The :mod:`test.support` module defines the following constants:
 
 .. data:: Py_DEBUG
 
-   True if Python was built with the :c:macro:`Py_DEBUG` macro
+   ``True`` if Python was built with the :c:macro:`Py_DEBUG` macro
    defined, that is, if
    Python was :ref:`built in debug mode <debug-build>`.
 
index ccf698af228d02e391e5b298dc598551696f2465..62298d96c2645989ff8dc3ae39c3d35c007dcabe 100644 (file)
@@ -25,8 +25,8 @@ Selection of a target object occurs as follows:
 #. Top-down search of area under mouse for target widget
 
  * Target widget should have a callable *dnd_accept* attribute
- * If *dnd_accept* is not present or returns None, search moves to parent widget
- * If no target widget is found, then the target object is None
+ * If *dnd_accept* is not present or returns ``None``, search moves to parent widget
+ * If no target widget is found, then the target object is ``None``
 
 2. Call to *<old_target>.dnd_leave(source, event)*
 #. Call to *<new_target>.dnd_enter(source, event)*
index 0641d8a68d5e9e9bd911e01c82a3af5535877b62..37778bf20bdcc72b9de5ef60dacb42c3be20a45c 100644 (file)
@@ -53,7 +53,7 @@ The :mod:`tty` module defines the following functions:
    is saved before setting *fd* to raw mode; this value is returned.
 
    .. versionchanged:: 3.12
-      The return value is now the original tty attributes, instead of None.
+      The return value is now the original tty attributes, instead of ``None``.
 
 
 .. function:: setcbreak(fd, when=termios.TCSAFLUSH)
@@ -67,7 +67,7 @@ The :mod:`tty` module defines the following functions:
    the minimum input to 1 byte with no delay.
 
    .. versionchanged:: 3.12
-      The return value is now the original tty attributes, instead of None.
+      The return value is now the original tty attributes, instead of ``None``.
 
    .. versionchanged:: 3.12.2
       The ``ICRNL`` flag is no longer cleared. This restores the behavior
index f53080e0610cb1f0edc3ba0072a959cd9220a61a..812589a3920ecd5881a02e47c661a0f91f03b71a 100644 (file)
@@ -2498,7 +2498,7 @@ types.
 
       This attribute reflects *only* the value of the ``total`` argument
       to the current ``TypedDict`` class, not whether the class is semantically
-      total. For example, a ``TypedDict`` with ``__total__`` set to True may
+      total. For example, a ``TypedDict`` with ``__total__`` set to ``True`` may
       have keys marked with :data:`NotRequired`, or it may inherit from another
       ``TypedDict`` with ``total=False``. Therefore, it is generally better to use
       :attr:`__required_keys__` and :attr:`__optional_keys__` for introspection.
index bd39f2cbc6570ca7f0a428ead7aa5e2322241af0..754405e0fbe5b29befdf22af47733cabbfc3bed6 100644 (file)
@@ -218,7 +218,7 @@ The following classes are provided:
 
    An appropriate ``Content-Type`` header should be included if the *data*
    argument is present.  If this header has not been provided and *data*
-   is not None, ``Content-Type: application/x-www-form-urlencoded`` will
+   is not ``None``, ``Content-Type: application/x-www-form-urlencoded`` will
    be added as a default.
 
    The next two arguments are only of interest for correct handling
index de2827461e2f241cedd5f2ecb8a9e3499a82a4fc..a1492298bdb86774981c27d3ab54b7733bacdd1d 100644 (file)
@@ -126,7 +126,7 @@ Python.
 
 Another thing you might notice is that not all data can be sorted or
 compared.  For instance, ``[None, 'hello', 10]`` doesn't sort because
-integers can't be compared to strings and *None* can't be compared to
+integers can't be compared to strings and ``None`` can't be compared to
 other types.  Also, there are some types that don't have a defined
 ordering relation.  For example, ``3+4j < 5+7j`` isn't a valid
 comparison.
index e6cf9c001a1a019b8d9081912a65d4ccb98dc75f..96a7cf6984dd9e85f27bd6ddb77e86ccc3362cf1 100644 (file)
@@ -2722,7 +2722,7 @@ Importing typing.io or typing.re now prints a ``DeprecationWarning``.
 .. section: Library
 
 argparse actions store_const and append_const each receive a default value
-of None when the ``const`` kwarg is not provided. Previously, this raised a
+of ``None`` when the ``const`` kwarg is not provided. Previously, this raised a
 :exc:`TypeError`.
 
 ..
@@ -3995,7 +3995,7 @@ operator expressions.
 .. section: Documentation
 
 Document that :class:`collections.defaultdict` parameter ``default_factory``
-defaults to None and is positional-only.
+defaults to ``None`` and is positional-only.
 
 ..
 
index a6b5fe54b391c531406c4b2f5a8a6a0cdfa685b8..f3fc62e9097162158580d6b9266e29ea97d2d55b 100644 (file)
@@ -331,8 +331,8 @@ underlying SQLite API signals memory error. Patch by Erlend E. Aasland.
 .. nonce: 4MQt4r
 .. section: Library
 
-pprint.pprint() now handles underscore_numbers correctly. Previously it was
-always setting it to False.
+:func:`pprint.pprint` now handles *underscore_numbers* correctly.
+Previously it was always setting it to ``False``.
 
 ..
 
index f929667965557336a2b525104339bcf91209d342..c35e8e2c1caf0726c802cd12abea7eeed73ece02 100644 (file)
@@ -58,10 +58,10 @@ may have prevented Python-to-Python calls respecting PEP 523.
 .. nonce: -igcjS
 .. section: Core and Builtins
 
-Add a closure keyword-only parameter to exec(). It can only be specified
+Add a closure keyword-only parameter to :func:`exec()`. It can only be specified
 when exec-ing a code object that uses free variables. When specified, it
 must be a tuple, with exactly the number of cell variables referenced by the
-code object. closure has a default value of None, and it must be None if the
+code object. closure has a default value of ``None``, and it must be ``None`` if the
 code object doesn't refer to any free variables.
 
 ..
@@ -664,8 +664,9 @@ for :func:`os.fcopyfile` available in macOs.
 .. nonce: l1p7CJ
 .. section: Library
 
-For @dataclass, add weakref_slot. Default is False. If True, and if
-slots=True, add a slot named "__weakref__", which will allow instances to be
+For :func:`@dataclass <dataclasses.dataclass>`, add *weakref_slot*.
+The new parameter defaults to ``False``. If true, and if
+``slots=True``, add a slot named ``"__weakref__"``, which will allow instances to be
 weakref'd. Contributed by Eric V. Smith
 
 ..
index f75a83c1d950d497a529a9010499755f3cef7e59..f2438d6608b7af42f0336133abff21a9d46e3d78 100644 (file)
@@ -3561,8 +3561,8 @@ with :func:`os.pidfd_open` in non-blocking mode. Patch by Kumar Aditya.
 .. nonce: mkYl5q
 .. section: Library
 
-Implement Enum __contains__ that returns True or False to replace the
-deprecated behaviour that would sometimes raise a TypeError.
+Implement ``Enum.__contains__`` that returns ``True`` or ``False`` to replace the
+deprecated behaviour that would sometimes raise a :exc:`TypeError`.
 
 ..
 
@@ -3729,7 +3729,7 @@ In a very special case, the email package tried to append the nonexistent
 .. nonce: e6uKxj
 .. section: Library
 
-Fix :func:`ast.unparse` when ``ImportFrom.level`` is None
+Fix :func:`ast.unparse` when ``ImportFrom.level`` is ``None``
 
 ..
 
@@ -3791,7 +3791,7 @@ the :c:type:`time_t` type in C.
 .. section: Library
 
 Fixed crash resulting from calling bisect.insort() or bisect.insort_left()
-with the key argument not equal to None.
+with the key argument not equal to ``None``.
 
 ..
 
@@ -4080,7 +4080,7 @@ replacement strings containing group references by 2--3 times.
 .. section: Library
 
 Fix findtext in the xml module to only give an empty string when the text
-attribute is set to None.
+attribute is set to ``None``.
 
 ..
 
index ce128fd5f80c77d2997f1b5001d20970d8d657a4..9b789c68607c732372e7eb32eff7c8caad88f452 100644 (file)
@@ -496,7 +496,7 @@ Created packages from zipfile and test_zipfile modules, separating
 
 Fix :attr:`~ipaddress.IPv4Address.is_private` properties in the
 :mod:`ipaddress` module. Previously non-private networks (0.0.0.0/0) would
-return True from this method; now they correctly return False.
+return ``True`` from this method; now they correctly return ``False``.
 
 ..
 
index 82faa5ad0b2031aacadf3a1cd8544d010ef3d68b..1599084ae0d3230731804be52a1d28096ec6d130 100644 (file)
@@ -65,8 +65,8 @@ redundant.
 .. nonce: M2n6Kg
 .. section: Core and Builtins
 
-Fix :func:`int.__sizeof__` calculation to include the 1 element ob_digit
-array for 0 and False.
+Fix :func:`int.__sizeof__` calculation to include the 1-element ``ob_digit``
+array for ``0`` and ``False``.
 
 ..
 
index 764b80b7b7d4362b44d832e4c18ccb08ad73850d..a264f7fad9e65a87066e5c51a92418d033969d00 100644 (file)
@@ -395,7 +395,7 @@ Fix bug in line numbers of instructions emitted for :keyword:`except*
 .. section: Core and Builtins
 
 Clarify :exc:`SyntaxWarning` with literal ``is`` comparison by specifying
-which literal is problematic, since comparisons using ``is`` with e.g. None
+which literal is problematic, since comparisons using ``is`` with e.g. ``None``
 and bool literals are idiomatic.
 
 ..
index 4937f9da5ae6290eeff2ab6aa9676879807117b9..0092db29460c3717b2af6c52dd55f330c3619752 100644 (file)
@@ -3436,7 +3436,8 @@ added support for this decorator. Patch by Alex Waygood.
 .. nonce: C1ahtk
 .. section: Library
 
-Make pydoc.doc catch bad module ImportError when output stream is not None.
+Make :func:`pydoc.doc` catch bad module :exc:`ImportError`
+when output stream is not ``None``.
 
 ..
 
index e5841e14c02efbf6db87ea9f274c71b6c90d3fc1..2480ee8202d0f4f037439682206615c71ff60a1c 100644 (file)
@@ -228,7 +228,7 @@ cross-interpreter API.  Patch by Anthony Shaw.
 .. nonce: ageUWQ
 .. section: Core and Builtins
 
-Add support for sharing of True and False between interpreters using the
+Add support for sharing of ``True`` and ``False`` between interpreters using the
 cross-interpreter API.  Patch by Anthony Shaw.
 
 ..
@@ -1354,8 +1354,8 @@ crash encountered after the first :meth:`tkinter.Tk` instance is destroyed.
 .. section: IDLE
 
 Add docstrings to the IDLE debugger module. Fix two bugs: initialize
-Idb.botframe (should be in Bdb); in Idb.in_rpc_code, check whether
-prev_frame is None before trying to use it. Greatly expand test_debugger.
+``Idb.botframe`` (should be in Bdb); in ``Idb.in_rpc_code``, check whether
+``prev_frame`` is ``None`` before trying to use it. Greatly expand test_debugger.
 
 ..
 
index 218ba609bd80c0aaa317b43e4e34ff8d720f5e1a..c2fe9dc1ad5aa00c1cc312190346e5edb8c3760e 100644 (file)
@@ -269,7 +269,7 @@ Correctly compute end column offsets for multiline tokens in the
 .. nonce: 4ADN7i
 .. section: Core and Builtins
 
-Fix None.__ne__(None) returning NotImplemented instead of False
+Fix ``None.__ne__(None)`` returning ``NotImplemented`` instead of ``False``.
 
 ..