10000 What's New in 3.12: List 'Improved Modules' alphabetically by hugovk · Pull Request #105315 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

What's New in 3.12: List 'Improved Modules' alphabetically #105315

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 3 commits into from
Jun 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
List 'Improved Modules' alphabetically
  • Loading branch information
hugovk committed Jun 5, 2023
commit e6ad1ba32eb059e6351f9a9f873b950f7235fd8b
202 changes: 101 additions & 101 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -553,46 +553,6 @@ csv
provide finer grained control of ``None`` and empty strings by
:class:`~csv.writer` objects.

inspect
-------

* Add :func:`inspect.markcoroutinefunction` to mark sync functions that return
a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`.
(Contributed Carlton Gibson in :gh:`99247`.)

* Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals`
for determining the current state of asynchronous generators.
(Contributed by Thomas Krennwallner in :issue:`35759`.)

* The performance of :func:`inspect.getattr_static` has been considerably
improved. Most calls to the function should be at least 2x faster than they
were in Python 3.11, and some may be 6x faster or more. (Contributed by Alex
Waygood in :gh:`103193`.)

pathlib
-------

* Add support for subclassing :class:`pathlib.PurePath` and
:class:`~pathlib.Path`, plus their Posix- and Windows-specific variants.
Subclasses may override the :meth:`~pathlib.PurePath.with_segments` method
to pass information between path instances.

* Add :meth:`~pathlib.Path.walk` for walking the directory trees and generating
all file or directory names within them, similar to :func:`os.walk`.
(Contributed by Stanislav Zmiev in :gh:`90385`.)

* Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to`
to allow the insertion of ``..`` entries in the result; this behavior is
more consistent with :func:`os.path.relpath`.
(Contributed by Domenico Ragusa in :issue:`40358`.)

* Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path.isjunction`.
(Contributed by Charles Machalow in :gh:`99547`.)

* Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`,
:meth:`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching
the path's case sensitivity, allowing for more precise control over the matching process.

dis
---

Expand All @@ -610,6 +570,22 @@ fractions
* Objects of type :class:`fractions.Fraction` now support float 10000 -style
formatting. (Contributed by Mark Dickinson in :gh:`100161`.)

inspect
-------

* Add :func:`inspect.markcoroutinefunction` to mark sync functions that return
a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`.
(Contributed Carlton Gibson in :gh:`99247`.)

* Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals`
for determining the current state of asynchronous generators.
(Contributed by Thomas Krennwallner in :issue:`35759`.)

* The performance of :func:`inspect.getattr_static` has been considerably
improved. Most calls to the function should be at least 2x faster than they
were in Python 3.11, and some may be 6x faster or more. (Contributed by Alex
Waygood in :gh:`103193`.)

itertools
---------

Expand Down Expand Up @@ -669,6 +645,30 @@ os.path
* Add :func:`os.path.splitroot` to split a path into a triad
``(drive, root, tail)``. (Contributed by Barney Gale in :gh:`101000`.)

pathlib
-------

* Add support for subclassing :class:`pathlib.PurePath` and
:class:`~pathlib.Path`, plus their Posix- and Windows-specific variants.
Subclasses may override the :meth:`~pathlib.PurePath.with_segments` method
to pass information between path instances.

* Add :meth:`~pathlib.Path.walk` for walking the directory trees and generating
all file or directory names within them, similar to :func:`os.walk`.
(Contributed by Stanislav Zmiev in :gh:`90385`.)

* Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to`
to allow the insertion of ``..`` entries in the result; this behavior is
more consistent with :func:`os.path.relpath`.
(Contributed by Domenico Ragusa in :issue:`40358`.)

* Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path.isjunction`.
(Contributed by Charles Machalow in :gh:`99547`.)

* Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`,
:meth:`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching
the path's case sensitivity, allowing for more precise control over the matching process.

pdb
---

Expand Down Expand Up @@ -746,6 +746,38 @@ statistics
for computing the Spearman correlation of ranked data.
(Contributed by Raymond Hettinger in :gh:`95861`.)

sys
---

* Add :func:`sys.activate_stack_trampoline` and
:func:`sys.deactivate_stack_trampoline` for activating and deactivating
stack profiler trampolines,
and :func:`sys.is_stack_trampoline_active` for querying if stack profiler
trampolines are active.
(Contributed by Pablo Galindo and Christian Heimes
with contributions from Gregory P. Smith [Google] and Mark Shannon
in :gh:`96123`.)

* Add :data:`sys.last_exc` which holds the last unhandled exception that
was raised (for post-mortem debugging use cases). Deprecate the
three fields that have the same information in its legacy form:
:data:`sys.last_type`, :data:`sys.last_value` and :data:`sys.last_traceback`.
(Contributed by Irit Katriel in :gh:`102778`.)

* :func:`sys._current_exceptions` now returns a mapping from thread-id to an
exception instance, rather than to a ``(typ, exc, tb)`` tuple.
(Contributed by Irit Katriel in :gh:`103176`.)

tempfile
--------

* The :class:`tempfile.NamedTemporaryFile` function has a new optional parameter
*delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)
* :func:`tempfile.mkdtemp` now always returns an absolute path, even if the
argument provided to the *dir* parameter is a relative path.

.. _whatsnew-typing-py312:

threading
---------

Expand Down Expand Up @@ -780,49 +812,6 @@ types
:ref:`user-defined-generics` when subclassed. (Contributed by
James Hilton-Balfe and Alex Waygood in :gh:`101827`.)

unicodedata
-----------

* The Unicode database has been updated to version 15.0.0. (Contributed by
Benjamin Peterson in :gh:`96734`).

unittest
--------

Added ``--durations`` command line option, showing the N slowest test cases::

python3 -m unittest --durations=3 lib.tests.test_threading
.....
Slowest test durations
----------------------------------------------------------------------
1.210s test_timeout (Lib.test.test_threading.BarrierTests)
1.003s test_default_timeout (Lib.test.test_threading.BarrierTests)
0.518s test_timeout (Lib.test.test_threading.EventTests)

(0.000 durations hidden. Use -v to show these durations.)
----------------------------------------------------------------------
Ran 158 tests in 9.869s

OK (skipped=3)

(Contributed by Giampaolo Rodola in :issue:`4080`)

uuid
----

* Add a :ref:`command-line interface <uuid-cli>`.
(Contributed by Adam Chhina in :gh:`88597`.)

tempfile
--------

* The :class:`tempfile.NamedTemporaryFile` function has a new optional parameter
*delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)
* :func:`tempfile.mkdtemp` now always returns an absolute path, even if the
argument provided to the *dir* parameter is a relative path.

.. _whatsnew-typing-py312:

typing
------

Expand Down Expand Up @@ -877,27 +866,38 @@ typing
* Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`.
(Contributed by Erik De Bonte in :gh:`99957`.)

sys
---
unicodedata
-----------

* Add :func:`sys.activate_stack_trampoline` and
:func:`sys.deactivate_stack_trampoline` for activating and deactivating
stack profiler trampolines,
and :func:`sys.is_stack_trampoline_active` for querying if stack profiler
trampolines are active.
(Contributed by Pablo Galindo and Christian Heimes
with contributions from Gregory P. Smith [Google] and Mark Shannon
in :gh:`96123`.)
* The Unicode database has been updated to version 15.0.0. (Contributed by
Benjamin Peterson in :gh:`96734`).

* Add :data:`sys.last_exc` which holds the last unhandled exception that
was raised (for post-mortem debugging use cases). Deprecate the
three fields that have the same information in its legacy form:
:data:`sys.last_type`, :data:`sys.last_value` and :data:`sys.last_traceback`.
(Contributed by Irit Katriel in :gh:`102778`.)
unittest
--------

* :func:`sys._current_exceptions` now returns a mapping from thread-id to an
exception instance, rather than to a ``(typ, exc, tb)`` tuple.
(Contributed by Irit Katriel in :gh:`103176`.)
Added ``--durations`` command line option, showing the N slowest test cases::

python3 -m unittest --durations=3 lib.tests.test_threading
.....
Slowest test durations
----------------------------------------------------------------------
1.210s test_timeout (Lib.test.test_threading.BarrierTests)
1.003s test_default_timeout (Lib.test.test_threading.BarrierTests)
0.518s test_timeout (Lib.test.test_threading.EventTests)

(0.000 durations hidden. Use -v to show these durations.)
----------------------------------------------------------------------
Ran 158 tests in 9.869s

OK (skipped=3)

(Contributed by Giampaolo Rodola in :issue:`4080`)

uuid
----

* Add a :ref:`command-line interface <uuid-cli>`.
(Contributed by Adam Chhina in :gh:`88597`.)


Optimizations
Expand Down
0