8000 What's New in 3.12: List 'Improved Modules' alphabetically (#105315) · python/cpython@eb0ce92 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb0ce92

Browse files
authored
What's New in 3.12: List 'Improved Modules' alphabetically (#105315)
1 parent f714aa2 commit eb0ce92

File tree

1 file changed

+107
-107
lines changed

1 file changed

+107
-107
lines changed

Doc/whatsnew/3.12.rst

+107-107
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ New typing features:
7474

7575
* :pep:`688`: Making the buffer protocol accessible in Python
7676

77-
* :ref:`whatsnew312-pep695`
78-
7977
* :ref:`whatsnew312-pep692`
8078

79+
* :ref:`whatsnew312-pep695`
80+
8181
* :pep:`698`: Override Decorator for Static Typing
8282

8383
Important deprecations, removals or restrictions:
@@ -179,7 +179,7 @@ same quote as the containing f-string. Let's cover these in detail:
179179
must be defined in a single line even if outside f-strings expressions could
180180
span multiple lines (like literal lists being defined over multiple lines),
181181
making them harder to read. In Python 3.12 you can now define expressions
182-
spaning multiple lines and include comments on them:
182+
spanning multiple lines and include comments on them:
183183

184184
>>> f"This is the playlist: {", ".join([
185185
... 'Take me back to Eden', # My, my, those eyes like fire
@@ -216,7 +216,7 @@ f-string raises a :exc:`SyntaxError`:
216216
^^^
217217
SyntaxError: f-string: invalid syntax. Perhaps you forgot a comma?
218218
219-
but the error message doesn't include the exact location of the error withing the line and
219+
but the error message doesn't include the exact location of the error within the line and
220220
also has the expression artificially surrounded by parentheses. In Python 3.12, as f-strings
221221
are parsed with the PEG parser, error messages can be more precise and show the entire line:
222222

@@ -553,46 +553,6 @@ csv
553553
provide finer grained control of ``None`` and empty strings by
554554
:class:`~csv.writer` objects.
555555

556-
inspect
557-
-------
558-
559-
* Add :func:`inspect.markcoroutinefunction` to mark sync functions that return
560-
a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`.
561-
(Contributed Carlton Gibson in :gh:`99247`.)
562-
563-
* Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals`
564-
for determining the current state of asynchronous generators.
565-
(Contributed by Thomas Krennwallner in :issue:`35759`.)
566-
567-
* The performance of :func:`inspect.getattr_static` has been considerably
568-
improved. Most calls to the function should be at least 2x faster than they
569-
were in Python 3.11, and some may be 6x faster or more. (Contributed by Alex
570-
Waygood in :gh:`103193`.)
571-
572-
pathlib
573-
-------
574-
575-
* Add support for subclassing :class:`pathlib.PurePath` and
576-
:class:`~pathlib.Path`, plus their Posix- and Windows-specific variants.
577-
Subclasses may override the :meth:`~pathlib.PurePath.with_segments` method
578-
to pass information between path instances.
579-
580-
* Add :meth:`~pathlib.Path.walk` for walking the directory trees and generating
581-
all file or directory names within them, similar to :func:`os.walk`.
582-
(Contributed by Stanislav Zmiev in :gh:`90385`.)
583-
584-
* Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to`
585-
to allow the insertion of ``..`` entries in the result; this behavior is
586-
more consistent with :func:`os.path.relpath`.
587-
(Contributed by Domenico Ragusa in :issue:`40358`.)
588-
589-
* Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path.isjunction`.
590-
(Contributed by Charles Machalow in :gh:`99547`.)
591-
592-
* Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`,
593-
:meth:`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching
594-
the path's case sensitivity, allowing for more precise control over the matching process.
595-
596556
dis
597557
---
598558

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

573+
inspect
574+
-------
575+
576+
* Add :func:`inspect.markcoroutinefunction` to mark sync functions that return
577+
a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`.
578+
(Contributed Carlton Gibson in :gh:`99247`.)
579+
580+
* Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals`
581+
for determining the current state of asynchronous generators.
582+
(Contributed by Thomas Krennwallner in :issue:`35759`.)
583+
584+
* The performance of :func:`inspect.getattr_static` has been considerably
585+
improved. Most calls to the function should be at least 2x faster than they
586+
were in Python 3.11, and some may be 6x faster or more. (Contributed by Alex
587+
Waygood in :gh:`103193`.)
588+
613589
itertools
614590
---------
615591

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

648+
pathlib
649+
-------
650+
651+
* Add support for subclassing :class:`pathlib.PurePath` and
652+
:class:`~pathlib.Path`, plus their Posix- and Windows-specific variants.
653+
Subclasses may override the :meth:`~pathlib.PurePath.with_segments` method
654+
to pass information between path instances.
655+
656+
* Add :meth:`~pathlib.Path.walk` for walking the directory trees and generating
657+
all file or directory names within them, similar to :func:`os.walk`.
658+
(Contributed by Stanislav Zmiev in :gh:`90385`.)
659+
660+
* Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to`
661+
to allow the insertion of ``..`` entries in the result; this behavior is
662+
more consistent with :func:`os.path.relpath`.
663+
(Contributed by Domenico Ragusa in :issue:`40358`.)
664+
665+
* Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path.isjunction`.
666+
(Contributed by Charles Machalow in :gh:`99547`.)
667+
668+
* Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`,
669+
:meth:`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching
670+
the path's case sensitivity, allowing for more precise control over the matching process.
671+
672672
pdb
673673
---
674674

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

749+
sys
750+
---
751+
752+
* Add :func:`sys.activate_stack_trampoline` and
753+
:func:`sys.deactivate_stack_trampoline` for activating and deactivating
754+
stack profiler trampolines,
755+
and :func:`sys.is_stack_trampoline_active` for querying if stack profiler
756+
trampolines are active.
757+
(Contributed by Pablo Galindo and Christian Heimes
758+
with contributions from Gregory P. Smith [Google] and Mark Shannon
759+
in :gh:`96123`.)
760+
761+
* Add :data:`sys.last_exc` which holds the last unhandled exception that
762+
was raised (for post-mortem debugging use cases). Deprecate the
763+
three fields that have the same information in its legacy form:
764+
:data:`sys.last_type`, :data:`sys.last_value` and :data:`sys.last_traceback`.
765+
(Contributed by Irit Katriel in :gh:`102778`.)
766+
767+
* :func:`sys._current_exceptions` now returns a mapping from thread-id to an
768+
exception instance, rather than to a ``(typ, exc, tb)`` tuple.
769+
(Contributed by Irit Katriel in :gh:`103176`.)
770+
771+
tempfile
772+
--------
773+
774+
* The :class:`tempfile.NamedTemporaryFile` function has a new optional parameter
775+
*delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)
776+
* :func:`tempfile.mkdtemp` now always returns an absolute path, even if the
777+
argument provided to the *dir* parameter is a relative path.
778+
779+
.. _whatsnew-typing-py312:
780+
749781
threading
750782
---------
751783

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

783-
unicodedata
784-
-----------
785-
786-
* The Unicode database has been updated to version 15.0.0. (Contributed by
787-
Benjamin Peterson in :gh:`96734`).
788-
789-
unittest
790-
--------
791-
792-
Added ``--durations`` command line option, showing the N slowest test cases::
793-
794-
python3 -m unittest --durations=3 lib.tests.test_threading
795-
.....
796-
Slowest test durations
797-
----------------------------------------------------------------------
798-
1.210s test_timeout (Lib.test.test_threading.BarrierTests)
799-
1.003s test_default_timeout (Lib.test.test_threading.BarrierTests)
800-
0.518s test_timeout (Lib.test.test_threading.EventTests)
801-
802-
(0.000 durations hidden. Use -v to show these durations.)
803-
----------------------------------------------------------------------
804-
Ran 158 tests in 9.869s
805-
806-
OK (skipped=3)
807-
808-
(Contributed by Giampaolo Rodola in :issue:`4080`)
809-
810-
uuid
811-
----
812-
813-
* Add a :ref:`command-line interface <uuid-cli>`.
814-
(Contributed by Adam Chhina in :gh:`88597`.)
815-
816-
tempfile
817-
--------
818-
819-
* The :class:`tempfile.NamedTemporaryFile` function has a new optional parameter
820-
*delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)
821-
* :func:`tempfile.mkdtemp` now always returns an absolute path, even if the
822-
argument provided to the *dir* parameter is a relative path.
823-
824-
.. _whatsnew-typing-py312:
825-
826815
typing
827816
------
828817

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

880-
sys
881-
---
869+
unicodedata
870+
-----------
882871

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

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

898-
* :func:`sys._current_exceptions` now returns a mapping from thread-id to an
899-
exception instance, rather than to a ``(typ, exc, tb)`` tuple.
900-
(Contributed by Irit Katriel in :gh:`103176`.)
878+
Added ``--durations`` command line option, showing the N slowest test cases::
879+
880+
python3 -m unittest --durations=3 lib.tests.test_threading
881+
.....
882+
Slowest test durations
883+
----------------------------------------------------------------------
884+
1.210s test_timeout (Lib.test.test_threading.BarrierTests)
885+
1.003s test_default_timeout (Lib.test.test_threading.BarrierTests)
886+
0.518s test_timeout (Lib.test.test_threading.EventTests)
887+
888+
(0.000 durations hidden. Use -v to show these durations.)
889+
----------------------------------------------------------------------
890+
Ran 158 tests in 9.869s
891+
892+
OK (skipped=3)
893+
894+
(Contributed by Giampaolo Rodola in :issue:`4080`)
895+
896+
uuid
897+
----
898+
899+
* Add a :ref:`command-line interface <uuid-cli>`.
900+
(Contributed by Adam Chhina in :gh:`88597`.)
901901

902902

903903
Optimizations
@@ -1486,7 +1486,7 @@ Changes in the Python API
14861486
1,13-1,17: FSTRING_MIDDLE ' end'
14871487
1,17-1,18: FSTRING_END '"'
14881488

1489-
Aditionally, there may be some minor behavioral changes as a consecuence of the
1489+
Additionally, there may be some minor behavioral changes as a consecuence of the
14901490
changes required to support :pep:`701`. Some of these changes include:
14911491

14921492
* Some final ``DEDENT`` tokens are now emitted within the bounds of the
@@ -1757,7 +1757,7 @@ Porting to Python 3.12
17571757
before storing it. (Contributed by Mark Shannon in :gh:`101578`.)
17581758

17591759
* ``_Py_RefTotal`` is no longer authoritative and only kept around
1760-
for ABI compabitility. Note that it is an internal global and only
1760+
for ABI compatibility. Note that it is an internal global and only
17611761
available on debug builds. If you happen to be using it then you'll
17621762
need to start using ``_Py_GetGlobalRefTotal()``.
17631763

0 commit comments

Comments
 (0)
0