Issue #19795: Mark up None as literal text.
diff --git a/Doc/c-api/none.rst b/Doc/c-api/none.rst
index aeaca97..f8909b9 100644
--- a/Doc/c-api/none.rst
+++ b/Doc/c-api/none.rst
@@ -2,8 +2,8 @@
.. _noneobject:
-The None Object
----------------
+The ``None`` Object
+-------------------
.. index:: object: None
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 85800c5..7c056f4 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -856,11 +856,11 @@
decode characters.
Decoding mappings must map single string characters to single Unicode
-characters, integers (which are then interpreted as Unicode ordinals) or None
+characters, integers (which are then interpreted as Unicode ordinals) or ``None``
(meaning "undefined mapping" and causing an error).
Encoding mappings must map single Unicode characters to single string
-characters, integers (which are then interpreted as Latin-1 ordinals) or None
+characters, integers (which are then interpreted as Latin-1 ordinals) or ``None``
(meaning "undefined mapping" and causing an error).
The mapping objects provided must only support the __getitem__ mapping
@@ -917,7 +917,7 @@
*NULL* when an exception was raised by the codec.
The *mapping* table must map Unicode ordinal integers to Unicode ordinal
- integers or None (causing deletion of the character).
+ integers or ``None`` (causing deletion of the character).
Mapping tables need only provide the :meth:`__getitem__` interface; dictionaries
and sequences work well. Unmapped character ordinals (ones which cause a
@@ -1019,7 +1019,7 @@
resulting Unicode object.
The mapping table must map Unicode ordinal integers to Unicode ordinal integers
- or None (causing deletion of the character).
+ or ``None`` (causing deletion of the character).
Mapping tables need only provide the :meth:`__getitem__` interface; dictionaries
and sequences work well. Unmapped character ordinals (ones which cause a
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
index 8f98c42..493f6ae 100644
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -308,7 +308,7 @@
While they could have been implemented that way, the actual C implementation of
:c:type:`PyMethod_Type` in :source:`Objects/classobject.c` is a single object
with two different representations depending on whether the :attr:`im_self`
-field is set or is *NULL* (the C equivalent of *None*).
+field is set or is *NULL* (the C equivalent of ``None``).
Likewise, the effects of calling a method object depend on the :attr:`im_self`
field. If set (meaning bound), the original function (stored in the
diff --git a/Doc/howto/sorting.rst b/Doc/howto/sorting.rst
index ac2aa31..6e31637 100644
--- a/Doc/howto/sorting.rst
+++ b/Doc/howto/sorting.rst
@@ -24,7 +24,7 @@
[1, 2, 3, 4, 5]
You can also use the :meth:`list.sort` method of a list. It modifies the list
-in-place (and returns *None* to avoid confusion). Usually it's less convenient
+in-place (and returns ``None`` to avoid confusion). Usually it's less convenient
than :func:`sorted` - but if you don't need the original list, it's slightly
more efficient.
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index af34895..f271d73 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -1500,7 +1500,7 @@
positional arguments
* description - description for the sub-parser group in help output, by
- default None
+ default ``None``
* prog - usage information that will be displayed with sub-command help,
by default the name of the program and any positional arguments before the
@@ -1513,12 +1513,12 @@
encountered at the command line
* dest_ - name of the attribute under which sub-command name will be
- stored; by default None and no value is stored
+ stored; by default ``None`` and no value is stored
- * help_ - help for sub-parser group in help output, by default None
+ * help_ - help for sub-parser group in help output, by default ``None``
* metavar_ - string presenting available sub-commands in help; by default it
- is None and presents sub-commands in form {cmd1, cmd2, ..}
+ is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}
Some example usage::
diff --git a/Doc/library/asyncore.rst b/Doc/library/asyncore.rst
index 31cd497..282a237 100644
--- a/Doc/library/asyncore.rst
+++ b/Doc/library/asyncore.rst
@@ -51,7 +51,7 @@
Enter a polling loop that terminates after count passes or all open
channels have been closed. All arguments are optional. The *count*
- parameter defaults to None, resulting in the loop terminating only when all
+ parameter defaults to ``None``, resulting in the loop terminating only when all
channels have been closed. The *timeout* argument sets the timeout
parameter for the appropriate :func:`~select.select` or :func:`~select.poll`
call, measured in seconds; the default is 30 seconds. The *use_poll*
diff --git a/Doc/library/bdb.rst b/Doc/library/bdb.rst
index 6980353..d9fee21 100644
--- a/Doc/library/bdb.rst
+++ b/Doc/library/bdb.rst
@@ -233,7 +233,7 @@
.. method:: set_continue()
Stop only at breakpoints or when finished. If there are no breakpoints,
- set the system trace function to None.
+ set the system trace function to ``None``.
.. method:: set_quit()
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 518e490..3c8c05f 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -237,7 +237,7 @@
.. versionadded:: 2.4
- If *maxlen* is not specified or is *None*, deques may grow to an
+ If *maxlen* is not specified or is ``None``, deques may grow to an
arbitrary length. Otherwise, the deque is bounded to the specified maximum
length. Once a bounded length deque is full, when new items are added, a
corresponding number of items are discarded from the opposite end. Bounded
@@ -321,7 +321,7 @@
.. attribute:: maxlen
- Maximum size of a deque or *None* if unbounded.
+ Maximum size of a deque or ``None`` if unbounded.
.. versionadded:: 2.7
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst
index 43be33e..4506805 100644
--- a/Doc/library/doctest.rst
+++ b/Doc/library/doctest.rst
@@ -1273,7 +1273,7 @@
.. attribute:: docstring
- The string that the test was extracted from, or 'None' if the string is
+ The string that the test was extracted from, or ``None`` if the string is
unavailable, or if the test was not extracted from a string.
@@ -1381,7 +1381,7 @@
not specified, then ``obj.__name__`` is used.
The optional parameter *module* is the module that contains the given object.
- If the module is not specified or is None, then the test finder will attempt
+ If the module is not specified or is ``None``, then the test finder will attempt
to automatically determine the correct module. The object's module is used:
* As a default namespace, if *globs* is not specified.
diff --git a/Doc/library/ensurepip.rst b/Doc/library/ensurepip.rst
index 7206300..a6358e4 100644
--- a/Doc/library/ensurepip.rst
+++ b/Doc/library/ensurepip.rst
@@ -94,7 +94,7 @@
Bootstraps ``pip`` into the current or designated environment.
*root* specifies an alternative root directory to install relative to.
- If *root* is None, then installation uses the default install location
+ If *root* is ``None``, then installation uses the default install location
for the current environment.
*upgrade* indicates whether or not to upgrade an existing installation
diff --git a/Doc/library/formatter.rst b/Doc/library/formatter.rst
index e696fec..9773908 100644
--- a/Doc/library/formatter.rst
+++ b/Doc/library/formatter.rst
@@ -344,7 +344,7 @@
.. class:: DumbWriter(file=None, maxcol=72)
Simple writer class which writes output on the file object passed in as *file*
- or, if *file* is None, on standard output. The output is simply word-wrapped
+ or, if *file* is ``None``, on standard output. The output is simply word-wrapped
to the number of columns specified by *maxcol*. This class is suitable for
reflowing a sequence of paragraphs.
diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst
index 20e377f..18f6d9d 100644
--- a/Doc/library/imaplib.rst
+++ b/Doc/library/imaplib.rst
@@ -90,7 +90,7 @@
Parse an IMAP4 ``INTERNALDATE`` string and return corresponding local
time. The return value is a :class:`time.struct_time` instance or
- None if the string has wrong format.
+ ``None`` if the string has wrong format.
.. function:: Int2AP(num)
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index c1b7bec..ec23d4f 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -95,8 +95,9 @@
| | gi_code | code object | |
+-----------+-----------------+---------------------------+-------+
| | gi_frame | frame object or possibly | |
-| | | None once the generator | |
-| | | has been exhausted | |
+| | | ``None`` once the | |
+| | | generator has been | |
+| | | exhausted | |
+-----------+-----------------+---------------------------+-------+
| | gi_running | set to 1 when generator | |
| | | is executing, 0 otherwise | |
@@ -478,7 +479,7 @@
four things is returned: ``(args, varargs, keywords, defaults)``. *args* is a
list of the argument names (it may contain nested lists). *varargs* and
*keywords* are the names of the ``*`` and ``**`` arguments or
- ``None``. *defaults* is a tuple of default argument values or None if there
+ ``None``. *defaults* is a tuple of default argument values or ``None`` if there
are no default arguments; if this tuple has *n* elements, they correspond to
the last *n* elements listed in *args*.
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index bf88dca..9e3e05e 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -403,7 +403,7 @@
(to raise :exc:`TypeError`).
If *skipkeys* is false (the default), then it is a :exc:`TypeError` to
- attempt encoding of keys that are not str, int, long, float or None. If
+ attempt encoding of keys that are not str, int, long, float or ``None``. If
*skipkeys* is true, such items are simply skipped.
If *ensure_ascii* is true (the default), all non-ASCII characters in the
diff --git a/Doc/library/logging.handlers.rst b/Doc/library/logging.handlers.rst
index 27167f0..3f5ef50 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -74,7 +74,7 @@
Returns a new instance of the :class:`FileHandler` class. The specified file is
opened and used as the stream for logging. If *mode* is not specified,
- :const:`'a'` is used. If *encoding* is not *None*, it is used to open the file
+ :const:`'a'` is used. If *encoding* is not ``None``, it is used to open the file
with that encoding. If *delay* is true, then file opening is deferred until the
first call to :meth:`emit`. By default, the file grows indefinitely.
@@ -154,7 +154,7 @@
Returns a new instance of the :class:`WatchedFileHandler` class. The specified
file is opened and used as the stream for logging. If *mode* is not specified,
- :const:`'a'` is used. If *encoding* is not *None*, it is used to open the file
+ :const:`'a'` is used. If *encoding* is not ``None``, it is used to open the file
with that encoding. If *delay* is true, then file opening is deferred until the
first call to :meth:`emit`. By default, the file grows indefinitely.
@@ -178,7 +178,7 @@
Returns a new instance of the :class:`RotatingFileHandler` class. The specified
file is opened and used as the stream for logging. If *mode* is not specified,
- ``'a'`` is used. If *encoding* is not *None*, it is used to open the file
+ ``'a'`` is used. If *encoding* is not ``None``, it is used to open the file
with that encoding. If *delay* is true, then file opening is deferred until the
first call to :meth:`emit`. By default, the file grows indefinitely.
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 4f6e4e8..4e2948a 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -588,7 +588,7 @@
:param args: Variable data to merge into the *msg* argument to obtain the
event description.
:param exc_info: An exception tuple with the current exception information,
- or *None* if no exception information is available.
+ or ``None`` if no exception information is available.
:param func: The name of the function or method from which the logging call
was invoked.
@@ -636,7 +636,7 @@
| | | (as returned by :func:`time.time`). |
+----------------+-------------------------+-----------------------------------------------+
| exc_info | You shouldn't need to | Exception tuple (à la ``sys.exc_info``) or, |
-| | format this yourself. | if no exception has occurred, *None*. |
+| | format this yourself. | if no exception has occurred, ``None``. |
+----------------+-------------------------+-----------------------------------------------+
| filename | ``%(filename)s`` | Filename portion of ``pathname``. |
+----------------+-------------------------+-----------------------------------------------+
@@ -1026,4 +1026,14 @@
package available from this site is suitable for use with Python 1.5.2, 2.1.x
and 2.2.x, which do not include the :mod:`logging` package in the standard
library.
+<<<<<<<
+=======
+ :lno: The line number in the file where the logging call was made.
+ :msg: The logging message.
+ :args: The arguments for the logging message.
+ :exc_info: An exception tuple, or ``None``.
+ :func: The name of the function or method which invoked the logging
+ call.
+ :sinfo: A stack traceback such as is provided by
+>>>>>>>
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index e33f85f..b393ad1 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -1800,7 +1800,7 @@
.. versionadded:: 2.7
*maxtasksperchild* is the number of tasks a worker process can complete
before it will exit and be replaced with a fresh worker process, to enable
- unused resources to be freed. The default *maxtasksperchild* is None, which
+ unused resources to be freed. The default *maxtasksperchild* is ``None``, which
means worker processes will live as long as the pool.
.. note::
@@ -2017,7 +2017,7 @@
``None`` then digest authentication is used.
If *authkey* is a string then it will be used as the authentication key;
- otherwise it must be *None*.
+ otherwise it must be ``None``.
If *authkey* is ``None`` and *authenticate* is ``True`` then
``current_process().authkey`` is used as the authentication key. If
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index 5466462..4af75a1 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -2028,12 +2028,12 @@
values.ensure_value(attr, value)
- If the ``attr`` attribute of ``values`` doesn't exist or is None, then
+ If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then
ensure_value() first sets it to ``value``, and then returns 'value. This is
very handy for actions like ``"extend"``, ``"append"``, and ``"count"``, all
of which accumulate data in a variable and expect that variable to be of a
certain type (a list for the first two, an integer for the latter). Using
:meth:`ensure_value` means that scripts using your action don't have to worry
about setting a default value for the option destinations in question; they
- can just leave the default as None and :meth:`ensure_value` will take care of
+ can just leave the default as ``None`` and :meth:`ensure_value` will take care of
getting it right when it's needed.
diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst
index b525705..4dd9e46 100644
--- a/Doc/library/queue.rst
+++ b/Doc/library/queue.rst
@@ -113,7 +113,7 @@
.. method:: Queue.put(item[, block[, timeout]])
Put *item* into the queue. If optional args *block* is true and *timeout* is
- None (the default), block if necessary until a free slot is available. If
+ ``None`` (the default), block if necessary until a free slot is available. If
*timeout* is a positive number, it blocks at most *timeout* seconds and raises
the :exc:`Full` exception if no free slot was available within that time.
Otherwise (*block* is false), put an item on the queue if a free slot is
@@ -132,7 +132,7 @@
.. method:: Queue.get([block[, timeout]])
Remove and return an item from the queue. If optional args *block* is true and
- *timeout* is None (the default), block if necessary until an item is available.
+ *timeout* is ``None`` (the default), block if necessary until an item is available.
If *timeout* is a positive number, it blocks at most *timeout* seconds and
raises the :exc:`Empty` exception if no item was available within that time.
Otherwise (*block* is false), return an item if one is immediately available,
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
index ad7deec..7a08045 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -295,7 +295,7 @@
Low level interface to kevent
- - changelist must be an iterable of kevent object or None
+ - changelist must be an iterable of kevent object or ``None``
- max_events must be 0 or a positive integer
- timeout in seconds (floats possible)
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 6b13172..bd5dd14 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -308,7 +308,7 @@
as the SQL function.
The function can return any of the types supported by SQLite: unicode, str, int,
- long, float, buffer and None.
+ long, float, buffer and ``None``.
Example:
@@ -324,7 +324,7 @@
final result of the aggregate.
The ``finalize`` method can return any of the types supported by SQLite:
- unicode, str, int, long, float, buffer and None.
+ unicode, str, int, long, float, buffer and ``None``.
Example:
@@ -346,7 +346,7 @@
.. literalinclude:: ../includes/sqlite3/collation_reverse.py
- To remove a collation, call ``create_collation`` with None as callable::
+ To remove a collation, call ``create_collation`` with ``None`` as callable::
con.create_collation("reverse", None)
@@ -868,7 +868,7 @@
(or none at all) via the *isolation_level* parameter to the :func:`connect`
call, or via the :attr:`isolation_level` property of connections.
-If you want **autocommit mode**, then set :attr:`isolation_level` to None.
+If you want **autocommit mode**, then set :attr:`isolation_level` to ``None``.
Otherwise leave it at its default, which will result in a plain "BEGIN"
statement, or set it to one of SQLite's supported isolation levels: "DEFERRED",
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index 5812af8..1302487 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -449,8 +449,8 @@
:meth:`SSLContext.set_default_verify_paths`. The return value is a
:term:`named tuple` ``DefaultVerifyPaths``:
- * :attr:`cafile` - resolved path to cafile or None if the file doesn't exist,
- * :attr:`capath` - resolved path to capath or None if the directory doesn't exist,
+ * :attr:`cafile` - resolved path to cafile or ``None`` if the file doesn't exist,
+ * :attr:`capath` - resolved path to capath or ``None`` if the directory doesn't exist,
* :attr:`openssl_cafile_env` - OpenSSL's environment key that points to a cafile,
* :attr:`openssl_cafile` - hard coded path to a cafile,
* :attr:`openssl_capath_env` - OpenSSL's environment key that points to a capath,
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 55733b9..c2af446 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -448,7 +448,7 @@
In addition to the above presentation types, integers can be formatted
with the floating point presentation types listed below (except
-``'n'`` and None). When doing so, :func:`float` is used to convert the
+``'n'`` and ``None``). When doing so, :func:`float` is used to convert the
integer to a floating point number before formatting.
The available presentation types for floating point and decimal values are:
diff --git a/Doc/library/ttk.rst b/Doc/library/ttk.rst
index c458e73..37463ca 100644
--- a/Doc/library/ttk.rst
+++ b/Doc/library/ttk.rst
@@ -1380,7 +1380,7 @@
Layouts
^^^^^^^
-A layout can be just None, if it takes no options, or a dict of
+A layout can be just ``None``, if it takes no options, or a dict of
options specifying how to arrange the element. The layout mechanism
uses a simplified version of the pack geometry manager: given an
initial cavity, each element is allocated a parcel. Valid
diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst
index 01da6a0..ca4f37e 100644
--- a/Doc/library/turtle.rst
+++ b/Doc/library/turtle.rst
@@ -529,7 +529,7 @@
:param n: an integer (or ``None``)
- Delete all or first/last *n* of turtle's stamps. If *n* is None, delete
+ Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete
all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete
last *n* stamps.
@@ -1857,10 +1857,10 @@
:param height: if an integer, the height in pixels, if a float, a fraction of
the screen; default is 75% of screen
:param startx: if positive, starting position in pixels from the left
- edge of the screen, if negative from the right edge, if None,
+ edge of the screen, if negative from the right edge, if ``None``,
center window horizontally
:param starty: if positive, starting position in pixels from the top
- edge of the screen, if negative from the bottom edge, if None,
+ edge of the screen, if negative from the bottom edge, if ``None``,
center window vertically
.. doctest::
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index 64a1834..b0eaae6 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -878,7 +878,7 @@
.. method:: assertIsNone(expr, msg=None)
assertIsNotNone(expr, msg=None)
- Test that *expr* is (or is not) None.
+ Test that *expr* is (or is not) ``None``.
.. versionadded:: 2.7
@@ -1240,7 +1240,7 @@
methods that delegate to it), :meth:`assertDictEqual` and
:meth:`assertMultiLineEqual`.
- Setting ``maxDiff`` to None means that there is no maximum length of
+ Setting ``maxDiff`` to ``None`` means that there is no maximum length of
diffs.
.. versionadded:: 2.7
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index 20cfc4c..a431b0f 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -639,7 +639,7 @@
.. method:: clear()
Resets an element. This function removes all subelements, clears all
- attributes, and sets the text and tail attributes to None.
+ attributes, and sets the text and tail attributes to ``None``.
.. method:: get(key, default=None)
@@ -855,8 +855,8 @@
Writes the element tree to a file, as XML. *file* is a file name, or a
file object opened for writing. *encoding* [1]_ is the output encoding
(default is US-ASCII). *xml_declaration* controls if an XML declaration
- should be added to the file. Use False for never, True for always, None
- for only if not US-ASCII or UTF-8 (default is None). *default_namespace*
+ should be added to the file. Use False for never, True for always, ``None``
+ for only if not US-ASCII or UTF-8 (default is ``None``). *default_namespace*
sets the default XML namespace (for "xmlns"). *method* is either
``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``). Returns an
encoded string.
diff --git a/Doc/library/xml.sax.reader.rst b/Doc/library/xml.sax.reader.rst
index 14af050..17aa8f0 100644
--- a/Doc/library/xml.sax.reader.rst
+++ b/Doc/library/xml.sax.reader.rst
@@ -306,7 +306,7 @@
Get the byte stream for this input source.
The getEncoding method will return the character encoding for this byte stream,
- or None if unknown.
+ or ``None`` if unknown.
.. method:: InputSource.setCharacterStream(charfile)
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 3f3b30f..81206ce 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -830,7 +830,7 @@
dictionary containing the class's namespace; :attr:`~class.__bases__` is a
tuple (possibly empty or a singleton) containing the base classes, in the
order of their occurrence in the base class list; :attr:`__doc__` is the
- class's documentation string, or None if undefined.
+ class's documentation string, or ``None`` if undefined.
Class instances
.. index::
@@ -1013,7 +1013,7 @@
called at the start of each source code line (this is used by the debugger);
:attr:`f_exc_type`, :attr:`f_exc_value`, :attr:`f_exc_traceback` represent the
last exception raised in the parent frame provided another exception was ever
- raised in the current frame (in all other cases they are None); :attr:`f_lineno`
+ raised in the current frame (in all other cases they are ``None``); :attr:`f_lineno`
is the current line number of the frame --- writing to this from within a trace
function jumps to the given line (only for the bottom-most frame). A debugger
can implement a Jump command (aka Set Next Statement) by writing to f_lineno.