(original) (raw)

changeset: 104555:5f997b3cb59c parent: 104551:465c09937e85 parent: 104554:2e97ed8e7e3c user: Serhiy Storchaka storchaka@gmail.com date: Wed Oct 19 16:39:36 2016 +0300 files: Doc/library/socket.rst Doc/library/timeit.rst description: Issue #19795: Mark up None as literal text. diff -r 465c09937e85 -r 5f997b3cb59c Doc/c-api/none.rst --- a/Doc/c-api/none.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/c-api/none.rst Wed Oct 19 16:39:36 2016 +0300 @@ -2,8 +2,8 @@ .. _noneobject: -The None Object ---------------- +The ``None`` Object +------------------- .. index:: object: None @@ -23,4 +23,4 @@ .. c:macro:: Py_RETURN_NONE Properly handle returning :c:data:`Py_None` from within a C function (that is, - increment the reference count of None and return it.) + increment the reference count of ``None`` and return it.) diff -r 465c09937e85 -r 5f997b3cb59c Doc/c-api/unicode.rst --- a/Doc/c-api/unicode.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/c-api/unicode.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1415,11 +1415,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 @@ -1460,7 +1460,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 @@ -1577,7 +1577,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 -r 465c09937e85 -r 5f997b3cb59c Doc/howto/descriptor.rst --- a/Doc/howto/descriptor.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/howto/descriptor.rst Wed Oct 19 16:39:36 2016 +0300 @@ -302,7 +302,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 -r 465c09937e85 -r 5f997b3cb59c Doc/howto/logging.rst --- a/Doc/howto/logging.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/howto/logging.rst Wed Oct 19 16:39:36 2016 +0300 @@ -764,7 +764,7 @@ The handler's level is set to ``WARNING``, so all events at this and greater severities will be output. -To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to *None*. +To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to ``None``. .. _library-config: diff -r 465c09937e85 -r 5f997b3cb59c Doc/howto/sorting.rst --- a/Doc/howto/sorting.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/howto/sorting.rst Wed Oct 19 16:39:36 2016 +0300 @@ -24,7 +24,7 @@ [1, 2, 3, 4, 5] You can also use the :meth:`list.sort` method. 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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/argparse.rst --- a/Doc/library/argparse.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/argparse.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1552,7 +1552,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 @@ -1565,12 +1565,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 - - * help_ - help for sub-parser group in help output, by default None + stored; by default ``None`` and no value is stored + + * 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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/asyncio-protocol.rst --- a/Doc/library/asyncio-protocol.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/asyncio-protocol.rst Wed Oct 19 16:39:36 2016 +0300 @@ -372,10 +372,10 @@ (for example by calling :meth:`write_eof`, if the other end also uses asyncio). - This method may return a false value (including None), in which case + This method may return a false value (including ``None``), in which case the transport will close itself. Conversely, if this method returns a true value, closing the transport is up to the protocol. Since the - default implementation returns None, it implicitly closes the connection. + default implementation returns ``None``, it implicitly closes the connection. .. note:: Some transports such as SSL don't support half-closed connections, diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/asyncore.rst --- a/Doc/library/asyncore.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/asyncore.rst Wed Oct 19 16:39:36 2016 +0300 @@ -57,7 +57,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/bdb.rst --- a/Doc/library/bdb.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/bdb.rst Wed Oct 19 16:39:36 2016 +0300 @@ -241,7 +241,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/code.rst --- a/Doc/library/code.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/code.rst Wed Oct 19 16:39:36 2016 +0300 @@ -150,7 +150,7 @@ The optional *exitmsg* argument specifies an exit message printed when exiting. Pass the empty string to suppress the exit message. If *exitmsg* is not given or - None, a default message is printed. + ``None``, a default message is printed. .. versionchanged:: 3.4 To suppress printing any banner, pass an empty string. diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/collections.rst --- a/Doc/library/collections.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/collections.rst Wed Oct 19 16:39:36 2016 +0300 @@ -412,7 +412,7 @@ position of the underlying data representation. - 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 @@ -520,7 +520,7 @@ .. attribute:: maxlen - Maximum size of a deque or *None* if unbounded. + Maximum size of a deque or ``None`` if unbounded. .. versionadded:: 3.1 diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/dis.rst --- a/Doc/library/dis.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/dis.rst Wed Oct 19 16:39:36 2016 +0300 @@ -56,12 +56,12 @@ notably :func:`get_instructions`, as iterating over a :class:`Bytecode` instance yields the bytecode operations as :class:`Instruction` instances. - If *first_line* is not None, it indicates the line number that should be + If *first_line* is not ``None``, it indicates the line number that should be reported for the first source line in the disassembled code. Otherwise, the source line information (if any) is taken directly from the disassembled code object. - If *current_offset* is not None, it refers to an instruction offset in the + If *current_offset* is not ``None``, it refers to an instruction offset in the disassembled code. Setting this means :meth:`.dis` will display a "current instruction" marker against the specified opcode. @@ -197,7 +197,7 @@ The iterator generates a series of :class:`Instruction` named tuples giving the details of each operation in the supplied code. - If *first_line* is not None, it indicates the line number that should be + If *first_line* is not ``None``, it indicates the line number that should be reported for the first source line in the disassembled code. Otherwise, the source line information (if any) is taken directly from the disassembled code object. @@ -249,7 +249,7 @@ .. data:: arg - numeric argument to operation (if any), otherwise None + numeric argument to operation (if any), otherwise ``None`` .. data:: argval @@ -269,7 +269,7 @@ .. data:: starts_line - line started by this opcode (if any), otherwise None + line started by this opcode (if any), otherwise ``None`` .. data:: is_jump_target diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/doctest.rst --- a/Doc/library/doctest.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/doctest.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1215,7 +1215,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. @@ -1320,7 +1320,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/ensurepip.rst --- a/Doc/library/ensurepip.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/ensurepip.rst Wed Oct 19 16:39:36 2016 +0300 @@ -96,7 +96,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/functools.rst --- a/Doc/library/functools.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/functools.rst Wed Oct 19 16:39:36 2016 +0300 @@ -52,7 +52,7 @@ Since a dictionary is used to cache results, the positional and keyword arguments to the function must be hashable. - If *maxsize* is set to None, the LRU feature is disabled and the cache can + If *maxsize* is set to ``None``, the LRU feature is disabled and the cache can grow without bound. The LRU feature performs best when *maxsize* is a power-of-two. diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/http.server.rst --- a/Doc/library/http.server.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/http.server.rst Wed Oct 19 16:39:36 2016 +0300 @@ -280,7 +280,7 @@ .. method:: date_time_string(timestamp=None) - Returns the date and time given by *timestamp* (which must be None or in + Returns the date and time given by *timestamp* (which must be ``None`` or in the format returned by :func:`time.time`), formatted for a message header. If *timestamp* is omitted, it uses the current date and time. diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/imaplib.rst --- a/Doc/library/imaplib.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/imaplib.rst Wed Oct 19 16:39:36 2016 +0300 @@ -128,7 +128,7 @@ Parse an IMAP4 ``INTERNALDATE`` string and return corresponding local time. The return value is a :class:`time.struct_time` tuple or - None if the string has wrong format. + ``None`` if the string has wrong format. .. function:: Int2AP(num) diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/importlib.rst --- a/Doc/library/importlib.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/importlib.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1056,7 +1056,7 @@ (``__loader__``) The loader to use for loading. For namespace packages this should be - set to None. + set to ``None``. .. attribute:: origin @@ -1064,33 +1064,33 @@ Name of the place from which the module is loaded, e.g. "builtin" for built-in modules and the filename for modules loaded from source. - Normally "origin" should be set, but it may be None (the default) + Normally "origin" should be set, but it may be ``None`` (the default) which indicates it is unspecified. .. attribute:: submodule_search_locations (``__path__``) - List of strings for where to find submodules, if a package (None + List of strings for where to find submodules, if a package (``None`` otherwise). .. attribute:: loader_state Container of extra module-specific data for use during loading (or - None). + ``None``). .. attribute:: cached (``__cached__``) - String for where the compiled module should be stored (or None). + String for where the compiled module should be stored (or ``None``). .. attribute:: parent (``__package__``) (Read-only) Fully-qualified name of the package to which the module - belongs as a submodule (or None). + belongs as a submodule (or ``None``). .. attribute:: has_location diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/json.rst --- a/Doc/library/json.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/json.rst Wed Oct 19 16:39:36 2016 +0300 @@ -407,8 +407,9 @@ (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, float or None. If - *skipkeys* is true, such items are simply skipped. + attempt encoding of keys that are not :class:`str`, :class:`int`, + :class:`float` or ``None``. If *skipkeys* is true, such items are simply + skipped. If *ensure_ascii* is true (the default), the output is guaranteed to have all incoming non-ASCII characters escaped. If *ensure_ascii* is diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/linecache.rst --- a/Doc/library/linecache.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/linecache.rst Wed Oct 19 16:39:36 2016 +0300 @@ -51,7 +51,7 @@ .. function:: lazycache(filename, module_globals) Capture enough detail about a non-file-based module to permit getting its - lines later via :func:`getline` even if *module_globals* is None in the later + lines later via :func:`getline` even if *module_globals* is ``None`` in the later call. This avoids doing I/O until a line is actually needed, without having to carry the module globals around indefinitely. diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/logging.config.rst --- a/Doc/library/logging.config.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/logging.config.rst Wed Oct 19 16:39:36 2016 +0300 @@ -138,7 +138,7 @@ across the socket, such that the ``verify`` callable can perform signature verification and/or decryption. The ``verify`` callable is called with a single argument - the bytes received across the socket - and should - return the bytes to be processed, or None to indicate that the bytes should + return the bytes to be processed, or ``None`` to indicate that the bytes should be discarded. The returned bytes could be the same as the passed in bytes (e.g. when only verification is done), or they could be completely different (perhaps if decryption were performed). diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/logging.handlers.rst --- a/Doc/library/logging.handlers.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/logging.handlers.rst Wed Oct 19 16:39:36 2016 +0300 @@ -80,7 +80,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. @@ -159,7 +159,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. @@ -275,7 +275,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/logging.rst --- a/Doc/library/logging.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/logging.rst Wed Oct 19 16:39:36 2016 +0300 @@ -296,7 +296,7 @@ Finds the caller's source filename and line number. Returns the filename, line number, function name and stack information as a 4-element tuple. The stack - information is returned as *None* unless *stack_info* is *True*. + information is returned as ``None`` unless *stack_info* is *True*. .. method:: Logger.handle(record) @@ -672,7 +672,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. :param sinfo: A text string representing stack information from the base of @@ -754,7 +754,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``. | +----------------+-------------------------+-----------------------------------------------+ @@ -1187,7 +1187,7 @@ :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. + :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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/mmap.rst --- a/Doc/library/mmap.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/mmap.rst Wed Oct 19 16:39:36 2016 +0300 @@ -204,13 +204,13 @@ .. method:: read([n]) Return a :class:`bytes` containing up to *n* bytes starting from the - current file position. If the argument is omitted, *None* or negative, + current file position. If the argument is omitted, ``None`` or negative, return all bytes from the current file position to the end of the mapping. The file position is updated to point after the bytes that were returned. .. versionchanged:: 3.3 - Argument can be omitted or *None*. + Argument can be omitted or ``None``. .. method:: read_byte() diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/multiprocessing.rst --- a/Doc/library/multiprocessing.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/multiprocessing.rst Wed Oct 19 16:39:36 2016 +0300 @@ -948,7 +948,7 @@ Return a context object which has the same attributes as the :mod:`multiprocessing` module. - If *method* is *None* then the default context is returned. + If *method* is ``None`` then the default context is returned. Otherwise *method* should be ``'fork'``, ``'spawn'``, ``'forkserver'``. :exc:`ValueError` is raised if the specified start method is not available. @@ -962,10 +962,10 @@ If the start method has not been fixed and *allow_none* is false, then the start method is fixed to the default and the name is returned. If the start method has not been fixed and *allow_none* - is true then *None* is returned. + is true then ``None`` is returned. The return value can be ``'fork'``, ``'spawn'``, ``'forkserver'`` - or *None*. ``'fork'`` is the default on Unix, while ``'spawn'`` is + or ``None``. ``'fork'`` is the default on Unix, while ``'spawn'`` is the default on Windows. .. versionadded:: 3.4 @@ -2059,7 +2059,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. *context* can be used to specify the context used for starting @@ -2329,7 +2329,7 @@ ``None`` then digest authentication is used. If *authkey* is a byte string then it will be used as the - authentication key; otherwise it must be *None*. + authentication key; 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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/nntplib.rst --- a/Doc/library/nntplib.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/nntplib.rst Wed Oct 19 16:39:36 2016 +0300 @@ -220,7 +220,7 @@ .. method:: NNTP.login(user=None, password=None, usenetrc=True) Send ``AUTHINFO`` commands with the user name and password. If *user* - and *password* are None and *usenetrc* is true, credentials from + and *password* are ``None`` and *usenetrc* is true, credentials from ``~/.netrc`` will be used if possible. Unless intentionally delayed, login is normally performed during the diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/optparse.rst --- a/Doc/library/optparse.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/optparse.rst Wed Oct 19 16:39:36 2016 +0300 @@ -2026,12 +2026,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/os.rst --- a/Doc/library/os.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/os.rst Wed Oct 19 16:39:36 2016 +0300 @@ -257,7 +257,7 @@ executable, similar to a shell, when launching a process. *env*, when specified, should be an environment variable dictionary to lookup the PATH in. - By default, when *env* is None, :data:`environ` is used. + By default, when *env* is ``None``, :data:`environ` is used. .. versionadded:: 3.2 @@ -3814,7 +3814,7 @@ .. function:: cpu_count() - Return the number of CPUs in the system. Returns None if undetermined. + Return the number of CPUs in the system. Returns ``None`` if undetermined. This number is not equivalent to the number of CPUs the current process can use. The number of usable CPUs can be obtained with diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/queue.rst --- a/Doc/library/queue.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/queue.rst Wed Oct 19 16:39:36 2016 +0300 @@ -106,7 +106,7 @@ .. method:: Queue.put(item, block=True, timeout=None) 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 @@ -122,7 +122,7 @@ .. method:: Queue.get(block=True, timeout=None) 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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/select.rst --- a/Doc/library/select.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/select.rst Wed Oct 19 16:39:36 2016 +0300 @@ -470,7 +470,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/smtplib.rst --- a/Doc/library/smtplib.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/smtplib.rst Wed Oct 19 16:39:36 2016 +0300 @@ -349,10 +349,10 @@ :rfc:`4954` "initial response" bytes which will be encoded and sent with the ``AUTH`` command as below. If the ``authobject()`` does not support an initial response (e.g. because it requires a challenge), it should return - None when called with ``challenge=None``. If *initial_response_ok* is - false, then ``authobject()`` will not be called first with None. + ``None`` when called with ``challenge=None``. If *initial_response_ok* is + false, then ``authobject()`` will not be called first with ``None``. - If the initial response check returns None, or if *initial_response_ok* is + If the initial response check returns ``None``, or if *initial_response_ok* is false, ``authobject()`` will be called to process the server's challenge response; the *challenge* argument it is passed will be a ``bytes``. It should return ``bytes`` *data* that will be base64 encoded and sent to the @@ -382,8 +382,9 @@ If *keyfile* and *certfile* are provided, these are passed to the :mod:`socket` module's :func:`ssl` function. - Optional *context* parameter is a :class:`ssl.SSLContext` object; This is an alternative to - using a keyfile and a certfile and if specified both *keyfile* and *certfile* should be None. + Optional *context* parameter is a :class:`ssl.SSLContext` object; This is + an alternative to using a keyfile and a certfile and if specified both + *keyfile* and *certfile* should be ``None``. If there has been no previous ``EHLO`` or ``HELO`` command this session, this method tries ESMTP ``EHLO`` first. diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/socket.rst --- a/Doc/library/socket.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/socket.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1400,10 +1400,10 @@ Set the value of the given socket option (see the Unix manual page :manpage:`setsockopt(2)`). The needed symbolic constants are defined in the :mod:`socket` module (:const:`SO_\*` etc.). The value can be an integer, - None or a :term:`bytes-like object` representing a buffer. In the later + ``None`` or a :term:`bytes-like object` representing a buffer. In the later case it is up to the caller to ensure that the bytestring contains the proper bits (see the optional built-in module :mod:`struct` for a way to - encode C structures as bytestrings). When value is set to None, + encode C structures as bytestrings). When value is set to ``None``, optlen argument is required. It's equivalent to call setsockopt C function with optval=NULL and optlen=optlen. diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/sqlite3.rst --- a/Doc/library/sqlite3.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/sqlite3.rst Wed Oct 19 16:39:36 2016 +0300 @@ -339,7 +339,7 @@ called as the SQL function. The function can return any of the types supported by SQLite: bytes, str, int, - float and None. + float and ``None``. Example: @@ -356,7 +356,7 @@ final result of the aggregate. The ``finalize`` method can return any of the types supported by SQLite: - bytes, str, int, float and None. + bytes, str, int, float and ``None``. Example: @@ -378,7 +378,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) @@ -939,7 +939,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/ssl.rst --- a/Doc/library/ssl.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/ssl.rst Wed Oct 19 16:39:36 2016 +0300 @@ -464,8 +464,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/stdtypes.rst --- a/Doc/library/stdtypes.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/stdtypes.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1756,13 +1756,13 @@ If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters (strings of length 1) to Unicode ordinals, - strings (of arbitrary lengths) or None. Character keys will then be + strings (of arbitrary lengths) or ``None``. Character keys will then be converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, - whose characters will be mapped to None in the result. + whose characters will be mapped to ``None`` in the result. .. method:: str.partition(sep) @@ -3760,7 +3760,7 @@ memory as an N-dimensional array. .. versionchanged:: 3.3 - An empty tuple instead of None when ndim = 0. + An empty tuple instead of ``None`` when ndim = 0. .. attribute:: strides @@ -3768,7 +3768,7 @@ access each element for each dimension of the array. .. versionchanged:: 3.3 - An empty tuple instead of None when ndim = 0. + An empty tuple instead of ``None`` when ndim = 0. .. attribute:: suboffsets diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/string.rst --- a/Doc/library/string.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/string.rst Wed Oct 19 16:39:36 2016 +0300 @@ -446,7 +446,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/subprocess.rst --- a/Doc/library/subprocess.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/subprocess.rst Wed Oct 19 16:39:36 2016 +0300 @@ -114,17 +114,17 @@ .. attribute:: stdout Captured stdout from the child process. A bytes sequence, or a string if - :func:`run` was called with an encoding or errors. None if stdout was not + :func:`run` was called with an encoding or errors. ``None`` if stdout was not captured. If you ran the process with ``stderr=subprocess.STDOUT``, stdout and stderr will be combined in this attribute, and :attr:`stderr` will be - None. + ``None``. .. attribute:: stderr Captured stderr from the child process. A bytes sequence, or a string if - :func:`run` was called with an encoding or errors. None if stderr was not + :func:`run` was called with an encoding or errors. ``None`` if stderr was not captured. .. method:: check_returncode() diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/sys.rst --- a/Doc/library/sys.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/sys.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1209,7 +1209,7 @@ .. note:: Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be - None. It is usually the case for Windows GUI apps that aren't connected + ``None``. It is usually the case for Windows GUI apps that aren't connected to a console and Python apps started with :program:`pythonw`. diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/test.rst --- a/Doc/library/test.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/test.rst Wed Oct 19 16:39:36 2016 +0300 @@ -398,7 +398,7 @@ A context manager that creates a temporary directory at *path* and yields the directory. - If *path* is None, the temporary directory is created using + If *path* is ``None``, the temporary directory is created using :func:`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an exception on error. Otherwise, if *path* is specified and cannot be created, only a warning is issued. @@ -421,7 +421,7 @@ The context manager creates a temporary directory in the current directory with name *name* before temporarily changing the current - working directory. If *name* is None, the temporary directory is + working directory. If *name* is ``None``, the temporary directory is created using :func:`tempfile.mkdtemp`. If *quiet* is ``False`` and it is not possible to create or change diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/threading.rst --- a/Doc/library/threading.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/threading.rst Wed Oct 19 16:39:36 2016 +0300 @@ -714,7 +714,7 @@ without an argument would block, return false immediately; otherwise, do the same thing as when called without arguments, and return true. - When invoked with a *timeout* other than None, it will block for at + When invoked with a *timeout* other than ``None``, it will block for at most *timeout* seconds. If acquire does not complete successfully in that interval, return false. Return true otherwise. @@ -854,8 +854,8 @@ Create a timer that will run *function* with arguments *args* and keyword arguments *kwargs*, after *interval* seconds have passed. - If *args* is None (the default) then an empty list will be used. - If *kwargs* is None (the default) then an empty dict will be used. + If *args* is ``None`` (the default) then an empty list will be used. + If *kwargs* is ``None`` (the default) then an empty dict will be used. .. versionchanged:: 3.3 changed from a factory function to a class. diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/timeit.rst --- a/Doc/library/timeit.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/timeit.rst Wed Oct 19 16:39:36 2016 +0300 @@ -145,7 +145,7 @@ 100, 1000, ...) up to a maximum of one billion, until the time taken is at least 0.2 second, or the maximum is reached. - If *callback* is given and is not *None*, it will be called after + If *callback* is given and is not ``None``, it will be called after each trial with two arguments: ``callback(number, time_taken)``. .. versionadded:: 3.6 diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/tkinter.ttk.rst --- a/Doc/library/tkinter.ttk.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/tkinter.ttk.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1404,7 +1404,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/turtle.rst --- a/Doc/library/turtle.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/turtle.rst Wed Oct 19 16:39:36 2016 +0300 @@ -549,7 +549,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. @@ -1799,7 +1799,7 @@ Pop up a dialog window for input of a string. Parameter title is the title of the dialog window, propmt is a text mostly describing what information to input. - Return the string input. If the dialog is canceled, return None. :: + Return the string input. If the dialog is canceled, return ``None``. :: >>> screen.textinput("NIM", "Name of first player:") @@ -1819,7 +1819,7 @@ The number input must be in the range minval .. maxval if these are given. If not, a hint is issued and the dialog remains open for correction. - Return the number input. If the dialog is canceled, return None. :: + Return the number input. If the dialog is canceled, return ``None``. :: >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000) @@ -1984,10 +1984,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/typing.rst --- a/Doc/library/typing.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/typing.rst Wed Oct 19 16:39:36 2016 +0300 @@ -718,7 +718,7 @@ This is often the same as ``obj.__annotations__``, but it handles forward references encoded as string literals, and if necessary - adds ``Optional[t]`` if a default value equal to None is set. + adds ``Optional[t]`` if a default value equal to ``None`` is set. .. decorator:: overload diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/unittest.mock.rst --- a/Doc/library/unittest.mock.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/unittest.mock.rst Wed Oct 19 16:39:36 2016 +0300 @@ -244,7 +244,7 @@ .. versionadded:: 3.5 - * *wraps*: Item for the mock object to wrap. If *wraps* is not None then + * *wraps*: Item for the mock object to wrap. If *wraps* is not ``None`` then calling the Mock will pass the call through to the wrapped object (returning the real result). Attribute access on the mock will return a Mock object that wraps the corresponding attribute of the wrapped diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/unittest.rst --- a/Doc/library/unittest.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/unittest.rst Wed Oct 19 16:39:36 2016 +0300 @@ -868,7 +868,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:: 3.1 @@ -1340,7 +1340,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:: 3.2 diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/urllib.request.rst Wed Oct 19 16:39:36 2016 +0300 @@ -495,7 +495,7 @@ .. attribute:: Request.data - The entity body for the request, or None if not specified. + The entity body for the request, or ``None`` if not specified. .. versionchanged:: 3.4 Changing value of :attr:`Request.data` now deletes "Content-Length" diff -r 465c09937e85 -r 5f997b3cb59c Doc/library/xml.sax.reader.rst --- a/Doc/library/xml.sax.reader.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/xml.sax.reader.rst Wed Oct 19 16:39:36 2016 +0300 @@ -308,7 +308,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 -r 465c09937e85 -r 5f997b3cb59c Doc/library/zipapp.rst --- a/Doc/library/zipapp.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/library/zipapp.rst Wed Oct 19 16:39:36 2016 +0300 @@ -121,7 +121,7 @@ the archive will be written to that file. * If it is an open file object, the archive will be written to that file object, which must be open for writing in bytes mode. - * If the target is omitted (or None), the source must be a directory + * If the target is omitted (or ``None``), the source must be a directory and the target will be a file with the same name as the source, with a ``.pyz`` extension added. diff -r 465c09937e85 -r 5f997b3cb59c Doc/reference/datamodel.rst --- a/Doc/reference/datamodel.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/reference/datamodel.rst Wed Oct 19 16:39:36 2016 +0300 @@ -771,7 +771,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; :attr:`__annotations__` (optional) is a dictionary containing :term:`variable annotations ` collected during class body execution. diff -r 465c09937e85 -r 5f997b3cb59c Doc/whatsnew/3.2.rst --- a/Doc/whatsnew/3.2.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/whatsnew/3.2.rst Wed Oct 19 16:39:36 2016 +0300 @@ -1439,7 +1439,7 @@ be a :term:`keyword argument`. The user-supplied filter function accepts a :class:`~tarfile.TarInfo` object and returns an updated :class:`~tarfile.TarInfo` object, or if it wants the file to be excluded, the -function can return *None*:: +function can return ``None``:: >>> import tarfile, glob @@ -1488,7 +1488,7 @@ syntax. The :func:`ast.literal_eval` function serves as a secure alternative to the builtin :func:`eval` function which is easily abused. Python 3.2 adds :class:`bytes` and :class:`set` literals to the list of supported types: -strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and None. +strings, bytes, numbers, tuples, lists, dicts, sets, booleans, and ``None``. :: diff -r 465c09937e85 -r 5f997b3cb59c Doc/whatsnew/3.3.rst --- a/Doc/whatsnew/3.3.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/whatsnew/3.3.rst Wed Oct 19 16:39:36 2016 +0300 @@ -182,7 +182,7 @@ * The maximum number of dimensions is officially limited to 64. * The representation of empty shape, strides and suboffsets is now - an empty tuple instead of None. + an empty tuple instead of ``None``. * Accessing a memoryview element with format 'B' (unsigned bytes) now returns an integer (in accordance with the struct module syntax). diff -r 465c09937e85 -r 5f997b3cb59c Doc/whatsnew/3.4.rst --- a/Doc/whatsnew/3.4.rst Wed Oct 19 11:08:07 2016 +0200 +++ b/Doc/whatsnew/3.4.rst Wed Oct 19 16:39:36 2016 +0300 @@ -161,7 +161,7 @@ * :ref:`Safe object finalization ` (:pep:`442`). * Leveraging :pep:`442`, in most cases :ref:`module globals are no longer set - to None during finalization ` (:issue:`18214`). + to ``None`` during finalization ` (:issue:`18214`). * :ref:`Configurable memory allocators ` (:pep:`445`). * :ref:`Argument Clinic ` (:pep:`436`)./storchaka@gmail.com