and compression. Common code patterns which can be optimized with
:func:`~bytearray.take_bytes` are listed below.
- (Contributed by Cody Maloney in :gh:`139871`.)
-
- .. list-table:: Suggested Optimizing Refactors
+ .. list-table:: Suggested optimizing refactors
:header-rows: 1
* - Description
buffer.resize(n)
data = buffer.take_bytes()
+ (Contributed by Cody Maloney in :gh:`139871`.)
+
* Many functions related to compiling or parsing Python code, such as
:func:`compile`, :func:`ast.parse`, :func:`symtable.symtable`,
- and :func:`importlib.abc.InspectLoader.source_to_code`, now allow to pass
- the module name. It is needed to unambiguous :ref:`filter <warning-filter>`
+ and :func:`importlib.abc.InspectLoader.source_to_code`, now allow the module
+ name to be passed. It is needed to unambiguously :ref:`filter <warning-filter>`
syntax warnings by module name.
(Contributed by Serhiy Storchaka in :gh:`135801`.)
(Contributed by Garry Cairns in :gh:`134567`.)
+venv
+----
+
+* On POSIX platforms, platlib directories will be created if needed when
+ creating virtual environments, instead of using ``lib64 -> lib`` symlink.
+ This means purelib and platlib of virtual environments no longer share the
+ same ``lib`` directory on platforms where :data:`sys.platlibdir` is not
+ equal to ``lib``.
+ (Contributed by Rui Xi in :gh:`133951`.)
+
+
warnings
--------
(Contributed by Serhiy Storchaka in :gh:`135801`.)
-venv
-----
-
-* On POSIX platforms, platlib directories will be created if needed when
- creating virtual environments, instead of using ``lib64 -> lib`` symlink.
- This means purelib and platlib of virtual environments no longer share the
- same ``lib`` directory on platforms where :data:`sys.platlibdir` is not
- equal to ``lib``.
- (Contributed by Rui Xi in :gh:`133951`.)
-
-
xml.parsers.expat
-----------------
This section lists previously described changes and other bugfixes
that may require changes to your code.
-* :class:`sqlite3.Connection` APIs has been cleaned up.
+* :class:`sqlite3.Connection` APIs have been cleaned up.
* All parameters of :func:`sqlite3.connect` except *database* are now keyword-only.
* The first three parameters of methods :meth:`~sqlite3.Connection.create_function`
* :meth:`~mmap.mmap.resize` has been removed on platforms that don't support the
underlying syscall, instead of raising a :exc:`SystemError`.
-* Resource warning is now emitted for unclosed
+* A resource warning is now emitted for an unclosed
:func:`xml.etree.ElementTree.iterparse` iterator if it opened a file.
Use its :meth:`!close` method or the :func:`contextlib.closing` context
manager to close it.