@@ -425,16 +425,16 @@ which represents a file system path. Code can use :func:`os.fspath`,
425425object.
426426
427427The built-in :func: `open ` function has been updated to accept
428- :class: `os.PathLike ` objects as have all relevant functions in the
429- :mod: `os ` and :mod: `os.path ` modules, as well as most functions and
428+ :class: `os.PathLike ` objects, as have all relevant functions in the
429+ :mod: `os ` and :mod: `os.path ` modules, and most other functions and
430430classes in the standard library. The :class: `os.DirEntry ` class
431431and relevant classes in :mod: `pathlib ` have also been updated to
432432implement :class: `os.PathLike `.
433433
434- The hope in is that updating the fundamental functions for operating
434+ The hope is that updating the fundamental functions for operating
435435on file system paths will lead to third-party code to implicitly
436436support all :term: `path-like objects <path-like object> ` without any
437- code changes or at least very minimal ones (e.g. calling
437+ code changes, or at least very minimal ones (e.g. calling
438438:func: `os.fspath ` at the beginning of code before operating on a
439439path-like object).
440440
@@ -635,18 +635,18 @@ PYTHONMALLOC environment variable
635635---------------------------------
636636
637637The new :envvar: `PYTHONMALLOC ` environment variable allows setting the Python
638- memory allocators and/or install debug hooks.
638+ memory allocators and installing debug hooks.
639639
640640It is now possible to install debug hooks on Python memory allocators on Python
641641compiled in release mode using ``PYTHONMALLOC=debug ``. Effects of debug hooks:
642642
643643* Newly allocated memory is filled with the byte ``0xCB ``
644644* Freed memory is filled with the byte ``0xDB ``
645- * Detect violations of Python memory allocator API. For example,
645+ * Detect violations of the Python memory allocator API. For example,
646646 :c:func: `PyObject_Free ` called on a memory block allocated by
647647 :c:func: `PyMem_Malloc `.
648- * Detect write before the start of the buffer (buffer underflow )
649- * Detect write after the end of the buffer (buffer overflow )
648+ * Detect writes before the start of a buffer (buffer underflows )
649+ * Detect writes after the end of a buffer (buffer overflows )
650650* Check that the :term: `GIL <global interpreter lock> ` is held when allocator
651651 functions of :c:data: `PYMEM_DOMAIN_OBJ ` (ex: :c:func: `PyObject_Malloc `) and
652652 :c:data: `PYMEM_DOMAIN_MEM ` (ex: :c:func: `PyMem_Malloc `) domains are called.
@@ -658,8 +658,8 @@ memory allocators.
658658
659659It is now also possible to force the usage of the :c:func: `malloc ` allocator of
660660the C library for all Python memory allocations using ``PYTHONMALLOC=malloc ``.
661- It helps to use external memory debuggers like Valgrind on a Python compiled in
662- release mode.
661+ This is helpful when using external memory debuggers like Valgrind on
662+ a Python compiled in release mode.
663663
664664On error, the debug hooks on Python memory allocators now use the
665665:mod: `tracemalloc ` module to get the traceback where a memory block was
@@ -754,7 +754,7 @@ Some smaller changes made to the core Python language are:
754754
755755* Import now raises the new exception :exc: `ModuleNotFoundError `
756756 (subclass of :exc: `ImportError `) when it cannot find a module. Code
757- that current checks for ImportError (in try-except) will still work.
757+ that currently checks for ImportError (in try-except) will still work.
758758 (Contributed by Eric Snow in :issue: `15767 `.)
759759
760760* Class methods relying on zero-argument ``super() `` will now work correctly
@@ -810,7 +810,7 @@ Contributed by Victor Stinner in :issue:`26146`.
810810asyncio
811811-------
812812
813- Starting with Python 3.6 the ``asyncio `` is no longer provisional and its
813+ Starting with Python 3.6 the ``asyncio `` module is no longer provisional and its
814814API is considered stable.
815815
816816Notable changes in the :mod: `asyncio ` module since Python 3.5.0
@@ -871,7 +871,7 @@ Notable changes in the :mod:`asyncio` module since Python 3.5.0
871871
872872* :meth: `Future.set_exception <asyncio.futures.Future.set_exception> `
873873 will now raise :exc: `TypeError ` when passed an instance of
874- :exc: `StopIteration ` exception.
874+ the :exc: `StopIteration ` exception.
875875 (Contributed by Chris Angelico in :issue: `26221 `.)
876876
877877* New :meth: `Loop.connect_accepted_socket() <asyncio.BaseEventLoop.connect_accepted_socket> `
@@ -909,7 +909,7 @@ added to represent sized iterable container classes.
909909(Contributed by Ivan Levkivskyi, docs by Neil Girdhar in :issue: `27598 `.)
910910
911911The new :class: `~collections.abc.Reversible ` abstract base class represents
912- iterable classes that also provide the :meth: `__reversed__ `.
912+ iterable classes that also provide the :meth: `__reversed__ ` method .
913913(Contributed by Ivan Levkivskyi in :issue: `25987 `.)
914914
915915The new :class: `~collections.abc.AsyncGenerator ` abstract base class represents
@@ -932,7 +932,7 @@ Recursive :class:`collections.deque` instances can now be pickled.
932932concurrent.futures
933933------------------
934934
935- The :class: `ThreadPoolExecutor <concurrent.futures.thread. ThreadPoolExecutor `
935+ The :class: `ThreadPoolExecutor <concurrent.futures.ThreadPoolExecutor> `
936936class constructor now accepts an optional *thread_name_prefix * argument
937937to make it possible to customize the names of the threads created by the
938938pool.
@@ -998,7 +998,7 @@ distutils
998998The ``default_format `` attribute has been removed from
999999:class: `distutils.command.sdist.sdist ` and the ``formats ``
10001000attribute defaults to ``['gztar'] ``. Although not anticipated,
1001- Any code relying on the presence of ``default_format `` may
1001+ any code relying on the presence of ``default_format `` may
10021002need to be adapted. See :issue: `27819 ` for more details.
10031003
10041004
@@ -1027,7 +1027,7 @@ for the new policies it is :class:`~email.message.EmailMessage`.
10271027encodings
10281028---------
10291029
1030- On Windows, added the ``'oem' `` encoding to use ``CP_OEMCP `` and the ``'ansi' ``
1030+ On Windows, added the ``'oem' `` encoding to use ``CP_OEMCP ``, and the ``'ansi' ``
10311031alias for the existing ``'mbcs' `` encoding, which uses the ``CP_ACP `` code page.
10321032(Contributed by Steve Dower in :issue: `27959 `.)
10331033
@@ -1192,7 +1192,7 @@ multiprocessing
11921192os
11931193--
11941194
1195- See the summary for :ref: `PEP 519 <whatsnew36-pep519 >` for details on how the
1195+ See the summary of :ref: `PEP 519 <whatsnew36-pep519 >` for details on how the
11961196:mod: `os ` and :mod: `os.path ` modules now support
11971197:term: `path-like objects <path-like object> `.
11981198
@@ -1219,7 +1219,7 @@ pathlib
12191219:mod: `pathlib ` now supports :term: `path-like objects <path-like object> `.
12201220(Contributed by Brett Cannon in :issue: `27186 `.)
12211221
1222- See the summary for :ref: `PEP 519 <whatsnew36-pep519 >` for details.
1222+ See the summary of :ref: `PEP 519 <whatsnew36-pep519 >` for details.
12231223
12241224
12251225pdb
@@ -1232,7 +1232,7 @@ to control whether ``.pdbrc`` files should be read.
12321232pickle
12331233------
12341234
1235- Objects that need calling ``__new__ `` with keyword arguments can now be pickled
1235+ Objects that need ``__new__ `` called with keyword arguments can now be pickled
12361236using :ref: `pickle protocols <pickle-protocols >` older than protocol version 4.
12371237Protocol version 4 already supports this case. (Contributed by Serhiy
12381238Storchaka in :issue: `24164 `.)
@@ -1241,7 +1241,7 @@ Storchaka in :issue:`24164`.)
12411241pickletools
12421242-----------
12431243
1244- :func: `pickletools.dis() ` now outputs implicit memo index for the
1244+ :func: `pickletools.dis() ` now outputs the implicit memo index for the
12451245``MEMOIZE `` opcode.
12461246(Contributed by Serhiy Storchaka in :issue: `25382 `.)
12471247
@@ -1278,7 +1278,7 @@ Match object groups can be accessed by ``__getitem__``, which is
12781278equivalent to ``group() ``. So ``mo['name'] `` is now equivalent to
12791279``mo.group('name') ``. (Contributed by Eric Smith in :issue: `24454 `.)
12801280
1281- :class: `~re.Match ` objects in the now support
1281+ :class: `~re.Match ` objects now support
12821282:meth: `index-like objects <object.__index__> ` as group
12831283indices.
12841284(Contributed by Jeroen Demeyer and Xiang Zhang in :issue: `27177 `.)
@@ -1338,7 +1338,7 @@ The :meth:`~socket.socket.getsockopt` constants ``SO_DOMAIN``,
13381338
13391339The :meth: `~socket.socket.setsockopt ` now supports the
13401340``setsockopt(level, optname, None, optlen: int) `` form.
1341- (Contributed by Christian Heimes in issue:`27744 `.)
1341+ (Contributed by Christian Heimes in : issue: `27744 `.)
13421342
13431343The socket module now supports the address family
13441344:data: `~socket.AF_ALG ` to interface with Linux Kernel crypto API. ``ALG_* ``,
@@ -1415,9 +1415,9 @@ subprocess
14151415
14161416:class: `subprocess.Popen ` destructor now emits a :exc: `ResourceWarning ` warning
14171417if the child process is still running. Use the context manager protocol (``with
1418- proc: ... ``) or call explicitly the :meth: `~subprocess.Popen.wait ` method to
1419- read the exit status of the child process (Contributed by Victor Stinner in
1420- :issue: `26741 `).
1418+ proc: ... ``) or explicitly call the :meth: `~subprocess.Popen.wait ` method to
1419+ read the exit status of the child process. (Contributed by Victor Stinner in
1420+ :issue: `26741 `.)
14211421
14221422The :class: `subprocess.Popen ` constructor and all functions that pass arguments
14231423through to it now accept *encoding * and *errors * arguments. Specifying either
@@ -1625,8 +1625,8 @@ A new optional *source* parameter has been added to the
16251625:class: `warnings.WarningMessage ` (contributed by Victor Stinner in
16261626:issue: `26568 ` and :issue: `26567 `).
16271627
1628- When a :exc: `ResourceWarning ` warning is logged, the :mod: `tracemalloc ` is now
1629- used to try to retrieve the traceback where the detroyed object was allocated.
1628+ When a :exc: `ResourceWarning ` warning is logged, the :mod: `tracemalloc ` module is now
1629+ used to try to retrieve the traceback where the destroyed object was allocated.
16301630
16311631Example with the script ``example.py ``::
16321632
@@ -1648,9 +1648,9 @@ Output of the command ``python3.6 -Wd -X tracemalloc=5 example.py``::
16481648 File "example.py", lineno 6
16491649 f = func()
16501650
1651- The "Object allocated at" traceback is new and only displayed if
1651+ The "Object allocated at" traceback is new and is only displayed if
16521652:mod: `tracemalloc ` is tracing Python memory allocations and if the
1653- :mod: `warnings ` was already imported.
1653+ :mod: `warnings ` module was already imported.
16541654
16551655
16561656winreg
@@ -1672,7 +1672,7 @@ xmlrpc.client
16721672-------------
16731673
16741674The :mod: `xmlrpc.client ` module now supports unmarshalling
1675- additional data types used by Apache XML-RPC implementation
1675+ additional data types used by the Apache XML-RPC implementation
16761676for numerics and ``None ``.
16771677(Contributed by Serhiy Storchaka in :issue: `26885 `.)
16781678
@@ -1703,16 +1703,16 @@ Xiang Zhang in :issue:`16764` respectively.)
17031703Optimizations
17041704=============
17051705
1706- * Python interpreter now uses 16-bit wordcode instead of bytecode which
1706+ * The Python interpreter now uses a 16-bit wordcode instead of bytecode which
17071707 made a number of opcode optimizations possible.
17081708 (Contributed by Demur Rumed with input and reviews from
17091709 Serhiy Storchaka and Victor Stinner in :issue: `26647 ` and :issue: `28050 `.)
17101710
1711- * The :class: `Future <asyncio.futures.Future> ` now has an optimized
1711+ * The :class: `Future <asyncio.futures.Future> ` class now has an optimized
17121712 C implementation.
17131713 (Contributed by Yury Selivanov and INADA Naoki in :issue: `26801 `.)
17141714
1715- * The :class: `Task <asyncio.tasks.Task> ` now has an optimized
1715+ * The :class: `Task <asyncio.tasks.Task> ` class now has an optimized
17161716 C implementation. (Contributed by Yury Selivanov in :issue: `28544 `.)
17171717
17181718* Various implementation improvements in the :mod: `typing ` module
@@ -1758,7 +1758,7 @@ Optimizations
17581758 deserializing many small objects (Contributed by Victor Stinner in
17591759 :issue: `27056 `).
17601760
1761- - Passing :term: `keyword arguments <keyword argument> ` to a function has an
1761+ * Passing :term: `keyword arguments <keyword argument> ` to a function has an
17621762 overhead in comparison with passing :term: `positional arguments
17631763 <positional argument> `. Now in extension functions implemented with using
17641764 Argument Clinic this overhead is significantly decreased.
@@ -1791,7 +1791,7 @@ Build and C API Changes
17911791 For more information, see :pep: `7 ` and :issue: `17884 `.
17921792
17931793* Cross-compiling CPython with the Android NDK and the Android API level set to
1794- 21 (Android 5.0 Lollilop) or greater, runs successfully. While Android is not
1794+ 21 (Android 5.0 Lollilop) or greater runs successfully. While Android is not
17951795 yet a supported platform, the Python test suite runs on the Android emulator
17961796 with only about 16 tests failures. See the Android meta-issue :issue: `26865 `.
17971797
@@ -1821,7 +1821,7 @@ Build and C API Changes
18211821 (Contributed by Eric Snow in :issue: `15767 `.)
18221822
18231823* The new :c:func: `PyErr_ResourceWarning ` function can be used to generate
1824- the :exc: `ResourceWarning ` providing the source of the resource allocation.
1824+ a :exc: `ResourceWarning ` providing the source of the resource allocation.
18251825 (Contributed by Victor Stinner in :issue: `26567 `.)
18261826
18271827* The new :c:func: `PyOS_FSPath ` function returns the file system
@@ -1977,7 +1977,7 @@ Deprecated functions and types of the C API
19771977Undocumented functions :c:func: `PyUnicode_AsEncodedObject `,
19781978:c:func: `PyUnicode_AsDecodedObject `, :c:func: `PyUnicode_AsEncodedUnicode `
19791979and :c:func: `PyUnicode_AsDecodedUnicode ` are deprecated now.
1980- Use :ref: `generic codec based API <codec-registry >` instead.
1980+ Use the :ref: `generic codec based API <codec-registry >` instead.
19811981
19821982
19831983Deprecated Build Options
@@ -2054,7 +2054,7 @@ Changes in the Python API
20542054 with ``'+' ``.
20552055 (Contributed by Jeff Balogh and John O'Connor in :issue: `2091 `.)
20562056
2057- * :mod: `sqlite3 ` no longer implicitly commit an open transaction before DDL
2057+ * :mod: `sqlite3 ` no longer implicitly commits an open transaction before DDL
20582058 statements.
20592059
20602060* On Linux, :func: `os.urandom ` now blocks until the system urandom entropy pool
@@ -2067,12 +2067,12 @@ Changes in the Python API
20672067 argument is not set. Previously only ``NULL `` was returned.
20682068
20692069* The format of the ``co_lnotab `` attribute of code objects changed to support
2070- negative line number delta. By default, Python does not emit bytecode with
2071- negative line number delta. Functions using ``frame.f_lineno ``,
2070+ a negative line number delta. By default, Python does not emit bytecode with
2071+ a negative line number delta. Functions using ``frame.f_lineno ``,
20722072 ``PyFrame_GetLineNumber() `` or ``PyCode_Addr2Line() `` are not affected.
2073- Functions decoding directly ``co_lnotab `` should be updated to use a signed
2074- 8-bit integer type for the line number delta, but it's only required to
2075- support applications using negative line number delta. See
2073+ Functions directly decoding ``co_lnotab `` should be updated to use a signed
2074+ 8-bit integer type for the line number delta, but this is only required to
2075+ support applications using a negative line number delta. See
20762076 ``Objects/lnotab_notes.txt `` for the ``co_lnotab `` format and how to decode
20772077 it, and see the :pep: `511 ` for the rationale.
20782078
@@ -2124,7 +2124,7 @@ Changes in the Python API
21242124 an error (e.g. ``EBADF ``) was reported by the underlying system call.
21252125 (Contributed by Martin Panter in :issue: `26685 `.)
21262126
2127- * The *decode_data * argument for :class: `smtpd.SMTPChannel ` and
2127+ * The *decode_data * argument for the :class: `smtpd.SMTPChannel ` and
21282128 :class: `smtpd.SMTPServer ` constructors is now ``False `` by default.
21292129 This means that the argument passed to
21302130 :meth: `~smtpd.SMTPServer.process_message ` is now a bytes object by
@@ -2204,24 +2204,24 @@ Changes in the Python API
22042204 (Contributed by Ramchandra Apte in :issue: `17211 `.)
22052205
22062206* :func: `re.sub ` now raises an error for invalid numerical group
2207- reference in replacement template even if the pattern is not
2208- found in the string. Error message for invalid group reference
2207+ references in replacement templates even if the pattern is not
2208+ found in the string. The error message for invalid group references
22092209 now includes the group index and the position of the reference.
22102210 (Contributed by SilentGhost, Serhiy Storchaka in :issue: `25953 `.)
22112211
22122212* :class: `zipfile.ZipFile ` will now raise :exc: `NotImplementedError ` for
22132213 unrecognized compression values. Previously a plain :exc: `RuntimeError `
2214- was raised. Additionally, calling :class: `~zipfile.ZipFile ` methods or
2215- on a closed ZipFile or calling :meth: `~zipfile.ZipFile.write ` methods
2214+ was raised. Additionally, calling :class: `~zipfile.ZipFile ` methods
2215+ on a closed ZipFile or calling the :meth: `~zipfile.ZipFile.write ` method
22162216 on a ZipFile created with mode ``'r' `` will raise a :exc: `ValueError `.
22172217 Previously, a :exc: `RuntimeError ` was raised in those scenarios.
22182218
22192219
22202220Changes in the C API
22212221--------------------
22222222
2223- * :c:func: `PyMem_Malloc ` allocator family now uses the :ref: `pymalloc allocator
2224- <pymalloc>` rather than system :c:func: `malloc `. Applications calling
2223+ * The :c:func: `PyMem_Malloc ` allocator family now uses the :ref: `pymalloc allocator
2224+ <pymalloc>` rather than the system :c:func: `malloc `. Applications calling
22252225 :c:func: `PyMem_Malloc ` without holding the GIL can now crash. Set the
22262226 :envvar: `PYTHONMALLOC ` environment variable to ``debug `` to validate the
22272227 usage of memory allocators in your application. See :issue: `26249 `.
0 commit comments