From ad13f338ceb12af0c883b720753cd59c03370485 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 19 Oct 2016 16:29:10 +0300 Subject: [PATCH] Issue #19795: Mark up None as literal text. --- Doc/c-api/none.rst | 4 ++-- Doc/c-api/unicode.rst | 8 ++++---- Doc/howto/descriptor.rst | 2 +- Doc/howto/sorting.rst | 2 +- Doc/library/argparse.rst | 8 ++++---- Doc/library/asyncore.rst | 2 +- Doc/library/bdb.rst | 2 +- Doc/library/collections.rst | 4 ++-- Doc/library/doctest.rst | 4 ++-- Doc/library/ensurepip.rst | 2 +- Doc/library/formatter.rst | 2 +- Doc/library/imaplib.rst | 2 +- Doc/library/inspect.rst | 7 ++++--- Doc/library/json.rst | 2 +- Doc/library/logging.handlers.rst | 6 +++--- Doc/library/logging.rst | 16 +++++++++++++--- Doc/library/multiprocessing.rst | 4 ++-- Doc/library/optparse.rst | 4 ++-- Doc/library/queue.rst | 4 ++-- Doc/library/select.rst | 2 +- Doc/library/sqlite3.rst | 8 ++++---- Doc/library/ssl.rst | 4 ++-- Doc/library/string.rst | 2 +- Doc/library/ttk.rst | 2 +- Doc/library/turtle.rst | 6 +++--- Doc/library/unittest.rst | 4 ++-- Doc/library/xml.etree.elementtree.rst | 6 +++--- Doc/library/xml.sax.reader.rst | 2 +- Doc/reference/datamodel.rst | 4 ++-- 29 files changed, 68 insertions(+), 57 deletions(-) diff --git a/Doc/c-api/none.rst b/Doc/c-api/none.rst index aeaca9719d..f8909b98ad 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 85800c5e5f..7c056f4f91 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -856,11 +856,11 @@ included in the :mod:`encodings` package). The codec uses mapping to encode and 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 @@ The following codec API is special in that maps Unicode to Unicode. *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 @@ They all return *NULL* or ``-1`` if an exception occurs. 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 8f98c4202e..493f6aed0e 100644 --- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -308,7 +308,7 @@ The output suggests that bound and unbound methods are two different types. 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 ac2aa31a5e..6e3163743f 100644 --- a/Doc/howto/sorting.rst +++ b/Doc/howto/sorting.rst @@ -24,7 +24,7 @@ returns a new sorted list:: [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 af3489597d..f271d73929 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1500,7 +1500,7 @@ Sub-commands 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 @@ Sub-commands 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 31cd497f59..282a2371c4 100644 --- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -51,7 +51,7 @@ any that have been added to the map during asynchronous service) is closed. 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 6980353d7a..d9fee21f4e 100644 --- a/Doc/library/bdb.rst +++ b/Doc/library/bdb.rst @@ -233,7 +233,7 @@ The :mod:`bdb` module also defines two classes: .. 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 518e49029f..3c8c05fee9 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -237,7 +237,7 @@ counts, but the output will exclude results with counts of zero or less. .. 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 @@ counts, but the output will exclude results with counts of zero or less. .. 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 43be33ef9e..4506805e02 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -1273,7 +1273,7 @@ DocTest Objects .. 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 @@ DocTestFinder objects 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 72063005c1..a6358e44b1 100644 --- a/Doc/library/ensurepip.rst +++ b/Doc/library/ensurepip.rst @@ -94,7 +94,7 @@ Module API 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 e696fec3e4..97739084fa 100644 --- a/Doc/library/formatter.rst +++ b/Doc/library/formatter.rst @@ -344,7 +344,7 @@ this module. Most applications will need to derive new writer classes from the .. 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 20e377f618..18f6d9dfe2 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -90,7 +90,7 @@ The following utility functions are defined: 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 c1b7bec4ff..ec23d4f09d 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -95,8 +95,9 @@ attributes: | | 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 @@ Classes and functions 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 bf88dca318..9e3e05e93b 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -403,7 +403,7 @@ Encoders and Decoders (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 27167f015a..3f5ef50636 100644 --- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -74,7 +74,7 @@ sends logging output to a disk file. It inherits the output functionality from 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 @@ for this value. 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 @@ module, supports rotation of disk log files. 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 4f6e4e8f4f..4e2948ab02 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -588,7 +588,7 @@ wire). :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 @@ format string. | | | (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 @@ with the :mod:`warnings` module. 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 e33f85f160..b393ad1345 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -1800,7 +1800,7 @@ with the :class:`Pool` class. .. 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 @@ authentication* using the :mod:`hmac` module. ``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 54664622b5..4af75a1014 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -2028,12 +2028,12 @@ Features of note: 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 b52570550d..4dd9e4678f 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -113,7 +113,7 @@ provide the public methods described below. .. 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 @@ provide the public methods described below. .. 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 ad7deecc1e..7a080457a0 100644 --- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -295,7 +295,7 @@ Kqueue Objects 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 6b13172042..bd5dd14691 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -308,7 +308,7 @@ Connection Objects 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 @@ Connection Objects 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 @@ Connection Objects .. 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 @@ You can control which kind of ``BEGIN`` statements sqlite3 implicitly executes (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 5812af8f87..130248759e 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -449,8 +449,8 @@ Certificate handling :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 55733b98c3..c2af446619 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -448,7 +448,7 @@ The available integer presentation types are: 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 c458e739c4..37463ca068 100644 --- a/Doc/library/ttk.rst +++ b/Doc/library/ttk.rst @@ -1380,7 +1380,7 @@ option. If the class name of a widget is unknown, use the method 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 01da6a0734..ca4f37e478 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -529,7 +529,7 @@ Turtle motion :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 @@ Methods specific to Screen, not inherited from TurtleScreen :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 64a1834784..b0eaae68a7 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -878,7 +878,7 @@ Test cases .. 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 @@ Test cases 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 20cfc4c9d3..a431b0fa22 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -639,7 +639,7 @@ Element Objects .. 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 @@ ElementTree Objects 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 14af0508af..17aa8f0571 100644 --- a/Doc/library/xml.sax.reader.rst +++ b/Doc/library/xml.sax.reader.rst @@ -306,7 +306,7 @@ InputSource Objects 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 3f3b30f4de..81206ce2d3 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -830,7 +830,7 @@ Classes 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 @@ Internal types 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. -- 2.50.1