cpython: 5f997b3cb59c (original) (raw)

--- 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 @@ -23,4 +23,4 @@ same reason. .. c:macro:: Py_RETURN_NONE Properly handle returning :c:data:Py_None from within a C function (that is,

--- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -1415,11 +1415,11 @@ included in the :mod:encodings package 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 @@ The following codec API is special in th NULL when an exception was raised by the codec. The mapping table must map Unicode ordinal integers to Unicode ordinal

--- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -302,7 +302,7 @@ The output suggests that bound and unbou 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

--- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -764,7 +764,7 @@ In Python 3.2 and later, the behaviour i 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:

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

--- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1552,7 +1552,7 @@ Sub-commands positional arguments * description - description for the sub-parser group in help output, by

* 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 @@ Sub-commands encountered at the command line * dest_ - name of the attribute under which sub-command name will be

-

+

Some example usage::

--- a/Doc/library/asyncio-protocol.rst +++ b/Doc/library/asyncio-protocol.rst @@ -372,10 +372,10 @@ The following callbacks are called on :c (for example by calling :meth:write_eof, if the other end also uses asyncio).

--- a/Doc/library/asyncore.rst +++ b/Doc/library/asyncore.rst @@ -57,7 +57,7 @@ any that have been added to the map duri Enter a polling loop that terminates after count passes or all open channels have been closed. All arguments are optional. The count

--- a/Doc/library/bdb.rst +++ b/Doc/library/bdb.rst @@ -241,7 +241,7 @@ The :mod:bdb module also defines two c .. method:: set_continue() Stop only at breakpoints or when finished. If there are no breakpoints,

.. method:: set_quit()

--- a/Doc/library/code.rst +++ b/Doc/library/code.rst @@ -150,7 +150,7 @@ interpreter objects as well as the follo 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

--- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -412,7 +412,7 @@ or subtracting from an empty counter. position of the underlying data representation.

.. versionadded:: 3.1

--- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -56,12 +56,12 @@ code. notably :func:get_instructions, as iterating over a :class:Bytecode instance yields the bytecode operations as :class:Instruction instances.

@@ -197,7 +197,7 @@ operation is being performed, so the int The iterator generates a series of :class:Instruction named tuples giving the details of each operation in the supplied code.

.. data:: argval @@ -269,7 +269,7 @@ details of bytecode instructions as :cla .. data:: starts_line

.. data:: is_jump_target

--- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -1215,7 +1215,7 @@ DocTest Objects .. attribute:: docstring

@@ -1320,7 +1320,7 @@ DocTestFinder objects not specified, then obj.__name__ is used. The optional parameter module is the module that contains the given object.

* As a default namespace, if globs is not specified.

--- a/Doc/library/ensurepip.rst +++ b/Doc/library/ensurepip.rst @@ -96,7 +96,7 @@ Module API Bootstraps pip into the current or designated environment. root specifies an alternative root directory to install relative to.

--- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -52,7 +52,7 @@ The :mod:functools module defines the Since a dictionary is used to cache results, the positional and keyword arguments to the function must be hashable.

--- a/Doc/library/http.server.rst +++ b/Doc/library/http.server.rst @@ -280,7 +280,7 @@ of which this module provides three diff .. method:: date_time_string(timestamp=None)

--- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -128,7 +128,7 @@ The following utility functions are defi Parse an IMAP4 INTERNALDATE string and return corresponding local time. The return value is a :class:time.struct_time tuple or

.. function:: Int2AP(num)

--- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1056,7 +1056,7 @@ find and load modules. (__loader__) The loader to use for loading. For namespace packages this should be

@@ -1064,33 +1064,33 @@ find and load modules. 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.

--- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -407,8 +407,9 @@ Encoders and Decoders (to raise :exc:TypeError). If skipkeys is false (the default), then it is a :exc:TypeError to

--- a/Doc/library/linecache.rst +++ b/Doc/library/linecache.rst @@ -51,7 +51,7 @@ The :mod:linecache module defines the .. function:: lazycache(filename, module_globals) Capture enough detail about a non-file-based module to permit getting its

--- a/Doc/library/logging.config.rst +++ b/Doc/library/logging.config.rst @@ -138,7 +138,7 @@ in :mod:logging itself) and defining h 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

--- a/Doc/library/logging.handlers.rst +++ b/Doc/library/logging.handlers.rst @@ -80,7 +80,7 @@ sends logging output to a disk file. It 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,

@@ -159,7 +159,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,

@@ -275,7 +275,7 @@ module, supports rotation of disk log fi 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/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -296,7 +296,7 @@ is the module's name in the Python packa 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

.. method:: Logger.handle(record) @@ -672,7 +672,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,

+----------------+-------------------------+-----------------------------------------------+ | 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 @@ functions. :lno: The line number in the file where the logging call was made. :msg: The logging message. :args: The arguments for the logging message.

--- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -204,13 +204,13 @@ To map anonymous memory, -1 should be pa .. method:: read([n]) Return a :class:bytes containing up to n bytes starting from the

.. versionchanged:: 3.3

.. method:: read_byte()

--- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -948,7 +948,7 @@ Miscellaneous Return a context object which has the same attributes as the :mod:multiprocessing module.

--- a/Doc/library/nntplib.rst +++ b/Doc/library/nntplib.rst @@ -220,7 +220,7 @@ tuples or objects that the method normal .. method:: NNTP.login(user=None, password=None, usenetrc=True) Send AUTHINFO commands with the user name and password. If user

--- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -2026,12 +2026,12 @@ Features of note: values.ensure_value(attr, value)

--- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -257,7 +257,7 @@ process and user. executable, similar to a shell, when launching a process. env, when specified, should be an environment variable dictionary to lookup the PATH in.

@@ -3814,7 +3814,7 @@ Miscellaneous System Information .. function:: cpu_count()

--- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -106,7 +106,7 @@ provide the public methods described bel .. method:: Queue.put(item, block=True, timeout=None) Put item into the queue. If optional args block is true and timeout is

--- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -470,7 +470,7 @@ Kqueue Objects Low level interface to kevent

--- a/Doc/library/smtplib.rst +++ b/Doc/library/smtplib.rst @@ -349,10 +349,10 @@ An :class:SMTP instance has the follow :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

--- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -1400,10 +1400,10 @@ to sockets. 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,

--- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -339,7 +339,7 @@ Connection Objects called as the SQL function. The function can return any of the types supported by SQLite: bytes, str, int,

Example: @@ -356,7 +356,7 @@ Connection Objects final result of the aggregate. The finalize method can return any of the types supported by SQLite:

Example: @@ -378,7 +378,7 @@ Connection Objects .. literalinclude:: ../includes/sqlite3/collation_reverse.py

con.create_collation("reverse", None) @@ -939,7 +939,7 @@ You can control which kind of BEGIN (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",

--- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -464,8 +464,8 @@ Certificate handling :meth:SSLContext.set_default_verify_paths. The return value is a :term:named tuple DefaultVerifyPaths:

--- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1756,13 +1756,13 @@ expression support in the :mod:re modu If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters (strings of length 1) to Unicode ordinals,

.. method:: str.partition(sep) @@ -3760,7 +3760,7 @@ copying. memory as an N-dimensional array. .. versionchanged:: 3.3

.. attribute:: strides @@ -3768,7 +3768,7 @@ copying. access each element for each dimension of the array. .. versionchanged:: 3.3

.. attribute:: suboffsets

--- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -446,7 +446,7 @@ The available integer presentation types 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:

--- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -114,17 +114,17 @@ compatibility with older versions, see t .. attribute:: stdout Captured stdout from the child process. A bytes sequence, or a string if

If you ran the process with stderr=subprocess.STDOUT, stdout and stderr will be combined in this attribute, and :attr:stderr will be

.. attribute:: stderr Captured stderr from the child process. A bytes sequence, or a string if

.. method:: check_returncode()

--- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1209,7 +1209,7 @@ always available. .. note:: Under some conditions stdin, stdout and stderr as well as the original values __stdin__, __stdout__ and __stderr__ can be

--- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -398,7 +398,7 @@ The :mod:test.support module defines t A context manager that creates a temporary directory at path and yields the directory.

--- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -714,7 +714,7 @@ Semaphores also support the :ref:`contex without an argument would block, return false immediately; otherwise, do the same thing as when called without arguments, and return true.

@@ -854,8 +854,8 @@ For example:: Create a timer that will run function with arguments args and keyword arguments kwargs, after interval seconds have passed.

--- a/Doc/library/timeit.rst +++ b/Doc/library/timeit.rst @@ -145,7 +145,7 @@ The module defines three convenience fun 100, 1000, ...) up to a maximum of one billion, until the time taken is at least 0.2 second, or the maximum is reached.

.. versionadded:: 3.6

--- a/Doc/library/tkinter.ttk.rst +++ b/Doc/library/tkinter.ttk.rst @@ -1404,7 +1404,7 @@ option. If you don't know the class name 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

--- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -549,7 +549,7 @@ Turtle motion :param n: an integer (or None)

@@ -1799,7 +1799,7 @@ Input methods 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.

@@ -1819,7 +1819,7 @@ Input methods 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.

@@ -1984,10 +1984,10 @@ Methods specific to Screen, not inherite :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

.. doctest::

--- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -718,7 +718,7 @@ The module defines the following classes This is often the same as obj.__annotations__, but it handles forward references encoded as string literals, and if necessary

.. decorator:: overload

--- a/Doc/library/unittest.mock.rst +++ b/Doc/library/unittest.mock.rst @@ -244,7 +244,7 @@ the new_callable argument to :func:`pa .. versionadded:: 3.5

--- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -868,7 +868,7 @@ Test cases .. method:: assertIsNone(expr, msg=None) assertIsNotNone(expr, msg=None)

.. versionadded:: 3.1 @@ -1340,7 +1340,7 @@ Test cases methods that delegate to it), :meth:assertDictEqual and :meth:assertMultiLineEqual.

.. versionadded:: 3.2

--- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -495,7 +495,7 @@ request. .. attribute:: Request.data

--- a/Doc/library/xml.sax.reader.rst +++ b/Doc/library/xml.sax.reader.rst @@ -308,7 +308,7 @@ InputSource Objects Get the byte stream for this input source. The getEncoding method will return the character encoding for this byte stream,

.. method:: InputSource.setCharacterStream(charfile)

--- a/Doc/library/zipapp.rst +++ b/Doc/library/zipapp.rst @@ -121,7 +121,7 @@ The module defines two convenience funct 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.

--- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -771,7 +771,7 @@ Custom 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

--- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -1439,7 +1439,7 @@ which is now deprecated. If specified, 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 @@ evaluating expression strings using the 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. ::

--- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -182,7 +182,7 @@ API changes

--- a/Doc/whatsnew/3.4.rst +++ b/Doc/whatsnew/3.4.rst @@ -161,7 +161,7 @@ CPython implementation improvements: