8000 gh-109975: Copyedit "What's New in Python 3.13" by hugovk · Pull Request #117902 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-109975: Copyedit "What's New in Python 3.13" #117902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to 8000
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Copyediting
  • Loading branch information
hugovk committed Apr 15, 2024
commit dec67fe5ec2219367305c22c9e066bbbf6b5cc61
120 changes: 64 additions & 56 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,8 @@ Other Language Changes
(Contributed by William Woodruff in :gh:`112389`.)

* The :class:`configparser.ConfigParser` now accepts unnamed sections before named
ones if configured to do so.

(Contributed by Pedro Sousa Lacerda in :gh:`66449`)
ones if configured to do so.
(Contributed by Pedro Sousa Lacerda in :gh:`66449`.)


New Modules
Expand All @@ -233,7 +232,7 @@ argparse
:meth:`~argparse.ArgumentParser.add_argument` and :meth:`!add_parser`
which allows to deprecate command-line options, positional arguments and
subcommands.
(Contributed by Serhiy Storchaka in :gh:`83648`).
(Contributed by Serhiy Storchaka in :gh:`83648`.)

array
-----
Expand Down Expand Up @@ -263,9 +262,9 @@ ast
argument that does not map to a field on the AST node is now deprecated,
and will raise an exception in Python 3.15.

* :func:`ast.parse` now accepts an optional argument ``optimize``
* :func:`ast.parse` now accepts an optional argument *optimize*
which is passed on to the :func:`compile` built-in. This makes it
possible to obtain an optimized ``AST``.
possible to obtain an optimized AST.
(Contributed by Irit Katriel in :gh:`108113`.)

asyncio
Expand Down Expand Up @@ -332,7 +331,7 @@ base64
------

* Add :func:`base64.z85encode` and :func:`base64.z85decode` functions which allow encoding
and decoding z85 data.
and decoding Z85 data.
See `Z85 specification <https://rfc.zeromq.org/spec/32/>`_ for more information.
(Contributed by Matan Perelman in :gh:`75299`.)

Expand Down Expand Up @@ -383,7 +382,7 @@ email
encountered instead of potentially inaccurate values. Add optional *strict*
parameter to these two functions: use ``strict=False`` to get the old
behavior, accept malformed inputs.
``getattr(email.utils, 'supports_strict_parsing', False)`` can be use to
``getattr(email.utils, 'supports_strict_parsing', False)`` can be used to
check if the *strict* parameter is available.
(Contributed by Thomas Dwyer and Victor Stinner for :gh:`102988` to improve
the CVE-2023-27043 fix.)
Expand All @@ -402,21 +401,22 @@ gc
* The cyclic garbage collector is now incremental, which changes the meanings
of the results of :meth:`gc.get_threshold` and :meth:`gc.set_threshold` as
well as :meth:`gc.get_count` and :meth:`gc.get_stats`.
* :meth:`gc.get_threshold` returns a three-tuple for backwards compatibility,
the first value is the threshold for young collections, as before, the second
value determines the rate at which the old collection is scanned; the
default is 10 and higher values mean that the old collection is scanned more slowly.
The third value is meangless and is always zero.
* :meth:`gc.set_threshold` ignores any items after the second.
* :meth:`gc.get_count` and :meth:`gc.get_stats`.
These functions return the same format of results as before.
The only difference is that instead of the results referring to
the young, aging and old generations, the results refer to the
young generation and the aging and collecting spaces of the old generation.

In summary, code that attempted to manipulate the behavior of the cycle GC may
not work exactly as intended, but it is very unlikely to harmful.
All other code will work just fine.

* :meth:`gc.get_threshold` returns a three-tuple for backwards compatibility,
t 8000 he first value is the threshold for young collections, as before, the second
value determines the rate at which the old collection is scanned; the
default is 10 and higher values mean that the old collection is scanned more slowly.
The third value is meaningless and is always zero.
* :meth:`gc.set_threshold` ignores any items after the second.
* :meth:`gc.get_count` and :meth:`gc.get_stats`
return the same format of results as before.
The only difference is that instead of the results referring to
the young, aging and old generations, the results refer to the
young generation and the aging and collecting spaces of the old generation.

In summary, code that attempted to manipulate the behavior of the cycle GC may
not work exactly as intended, but it is very unlikely to harmful.
All other code will work just fine.

glob
----
Expand All @@ -428,43 +428,46 @@ glob
importlib
---------

Previously deprecated :mod:`importlib.resources` functions are un-deprecated:
* Previously deprecated :mod:`importlib.resources` functions are un-deprecated:

* :func:`~importlib.resources.is_resource()`
* :func:`~importlib.resources.open_binary()`
* :func:`~importlib.resources.open_text()`
* :func:`~importlib.resources.path()`
* :func:`~importlib.resources.read_binary()`
* :func:`~importlib.resources.read_text()`
* :func:`~importlib.resources.is_resource()`
* :func:`~importlib.resources.open_binary()`
* :func:`~importlib.resources.open_text()`
* :func:`~importlib.resources.path()`
* :func:`~importlib.resources.read_binary()`
* :func:`~importlib.resources.read_text()`

All now allow for a directory (or tree) of resources, using multiple positional
arguments.
All now allow for a directory (or tree) of resources, using multiple positional
arguments.

For text-reading functions, the *encoding* and *errors* must now be given as
keyword arguments.
For text-reading functions, the *encoding* and *errors* must now be given as
keyword arguments.

The :func:`~importlib.resources.contents()` remains deprecated in favor of
the full-featured :class:`~importlib.resources.abc.Traversable` API.
However, there is now no plan to remove it.
The :func:`~importlib.resources.contents()` remains deprecated in favor of
the full-featured :class:`~importlib.resources.abc.Traversable` API.
However, there is now no plan to remove it.

(Contributed by Petr Viktorin in :gh:`106532`.)
(Contributed by Petr Viktorin in :gh:`106532`.)

io
--

The :class:`io.IOBase` finalizer now logs the ``close()`` method errors with
:data:`sys.unraisablehook`. Previously, errors were ignored silently by default,
and only logged in :ref:`Python Development Mode <devmode>` or on :ref:`Python
built on debug mode <debug-build>`.
(Contributed by Victor Stinner in :gh:`62948`.)
* The :class:`io.IOBase` finalizer now logs the ``close()`` method errors with
:data:`sys.unraisablehook`. Previously, errors were ignored silently by default,
and only logged in :ref:`Python Development Mode <devmode>` or on :ref:`Python
built on debug mode <debug-build>`.
(Contributed by Victor Stinner in :gh:`62948`.)

ipaddress
---------

* Add the :attr:`ipaddress.IPv4Address.ipv6_mapped` property, which returns the IPv4-mapped IPv6 address.
(Contributed by Charles Machalow in :gh:`109466`.)
* Fix ``is_global`` and ``is_private`` behavior in ``IPv4Address``, ``IPv6Address``, ``IPv4Network``
and ``IPv6Network``.
* Fix ``is_global`` and ``is_private`` behavior in
:class:`~ipaddress.IPv4Address`,
:class:`~ipaddress.IPv6Address`,
:class:`~ipaddress.IPv4Network` and
:class:`~ipaddress.IPv6Network`.

itertools
---------
Expand All @@ -485,12 +488,12 @@ marshal
math
----

A new function :func:`~math.fma` for fused multiply-add operations has been
added. This function computes ``x * y + z`` with only a single round, and so
avoids any intermediate loss of precision. It wraps the ``fma()`` function
provided by C99, and follows the specification of the IEEE 754
"fusedMultiplyAdd" operation for special cases.
(Contributed by Mark Dickinson and Victor Stinner in :gh:`73468`.)
* A new function :func:`~math.fma` for fused multiply-add operations has been
added. This function computes ``x * y + z`` with only a single round, and so
avoids any intermediate loss of precision. It wraps the ``fma()`` function
provided by C99, and follows the specification of the IEEE 754
"fusedMultiplyAdd" operation for special cases.
(Contributed by Mark Dickinson and Victor Stinner in :gh:`73468`.)

mmap
----
Expand Down Expand Up @@ -586,18 +589,18 @@ pathlib

* Add *recurse_symlinks* keyword-only argument to :meth:`pathlib.Path.glob`
and :meth:`~pathlib.Path.rglob`.
(Contributed by Barney Gale in :gh:`77609`).
(Contributed by Barney Gale in :gh:`77609`.)

* Add *follow_symlinks* keyword-only argument to :meth:`~pathlib.Path.is_file`,
:meth:`~pathlib.Path.is_dir`, :meth:`~pathlib.Path.owner`,
:meth:`~pathlib.Path.group`.
(Contributed by Barney Gale in :gh:`105793`, and Kamil Turek in
:gh:`107962`).
:gh:`107962`.)

* Return files and directories from :meth:`pathlib.Path.glob` and
:meth:`~pathlib.Path.rglob` when given a pattern that ends with "``**``". In
earlier versions, only directories were returned.
(Contributed by Barney Gale in :gh:`70303`).
(Contributed by Barney Gale in :gh:`70303`.)

pdb
---
Expand Down Expand Up @@ -646,6 +649,8 @@ statistics
from a fixed number of discrete samples.
(Contributed by Raymond Hettinger in :gh:`115863`.)

.. _whatsnew313-subprocess:

subprocess
----------

Expand Down Expand Up @@ -678,7 +683,7 @@ time

* On Windows, :func:`time.time()` now uses the
``GetSystemTimePreciseAsFileTime()`` clock to have a resolution better
than 1 us, instead of the ``GetSystemTimeAsFileTime()`` clock which has a
than 1 μs, instead of the ``GetSystemTimeAsFileTime()`` clock which has a
resolution of 15.6 ms.
(Contributed by Victor Stinner in :gh:`63207`.)

Expand Down Expand Up @@ -785,7 +790,8 @@ Optimizations
* The :mod:`subprocess` module uses :func:`os.posix_spawn` in more situations
including the default where ``close_fds=True`` on many modern platforms. This
should provide a noteworthy performance increase launching processes on
FreeBSD and Solaris. See the ``subprocess`` section above for details.
FreeBSD and Solaris. See the :ref:`subprocess <whatsnew313-subprocess>`
section above for details.
(Contributed by Jakub Kulik in :gh:`113117`.)

.. _whatsnew313-jit-compiler:
Expand Down Expand Up @@ -824,6 +830,8 @@ The internal architecture is roughly as follows.
*copy-and-patch*. It has no runtime dependencies, but there is a new
build-time dependency on LLVM.

See :pep:`744` for more details.

(JIT by Brandt Bucher, inspired by a paper by Haoran Xu and Fredrik Kjolstad.
Tier 2 IR by Mark Shannon and Guido van Rossum.
Tier 2 optimizer by Ken Jin.)
Expand Down
0