Skip to content

Commit a6b367a

Browse files
hugovkclin1234
authored andcommitted
pythongh-133879: Copyedit "What's new in Python 3.15" (python#146345)
1 parent 3c3e2a6 commit a6b367a

1 file changed

Lines changed: 80 additions & 71 deletions

File tree

Doc/whatsnew/3.15.rst

Lines changed: 80 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -690,26 +690,6 @@ collections
690690
(Contributed by Raymond Hettinger in :gh:`138682`.)
691691

692692

693-
collections.abc
694-
---------------
695-
696-
* :class:`collections.abc.ByteString` has been removed from
697-
``collections.abc.__all__``. :class:`!collections.abc.ByteString` has been
698-
deprecated since Python 3.12, and is scheduled for removal in Python 3.17.
699-
700-
* The following statements now cause ``DeprecationWarning``\ s to be emitted at
701-
runtime:
702-
703-
* ``from collections.abc import ByteString``
704-
* ``import collections.abc; collections.abc.ByteString``.
705-
706-
``DeprecationWarning``\ s were already emitted if
707-
:class:`collections.abc.ByteString` was subclassed or used as the second
708-
argument to :func:`isinstance` or :func:`issubclass`, but warnings were not
709-
previously emitted if it was merely imported or accessed from the
710-
:mod:`!collections.abc` module.
711-
712-
713693
concurrent.futures
714694
------------------
715695

@@ -836,13 +816,12 @@ mimetypes
836816

837817
* Add ``application/dicom`` MIME type for ``.dcm`` extension.
838818
(Contributed by Benedikt Johannes in :gh:`144217`.)
819+
* Add ``application/efi``. (Contributed by Charlie Lin in :gh:`145720`.)
839820
* Add ``application/node`` MIME type for ``.cjs`` extension.
840821
(Contributed by John Franey in :gh:`140937`.)
841822
* Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.)
842823
* Add ``application/sql`` and ``application/vnd.sqlite3``.
843824
(Contributed by Charlie Lin in :gh:`145698`.)
844-
* Add ``image/jxl``. (Contributed by Foolbar in :gh:`144213`.)
845-
* Add ``application/efi``. (Contributed by Charlie Lin in :gh:`145720`.)
846825
* Add the following MIME types:
847826

848827
- ``application/vnd.ms-cab-compressed`` for ``.cab`` extension
@@ -860,6 +839,7 @@ mimetypes
860839

861840
(Contributed by Charlie Lin in :gh:`145918`.)
862841

842+
* Add ``image/jxl``. (Contributed by Foolbar in :gh:`144213`.)
863843
* Rename ``application/x-texinfo`` to ``application/texinfo``.
864844
(Contributed by Charlie Lin in :gh:`140165`.)
865845
* Changed the MIME type for ``.ai`` files to ``application/pdf``.
@@ -969,7 +949,7 @@ ssl
969949
---
970950

971951
* Indicate through :data:`ssl.HAS_PSK_TLS13` whether the :mod:`ssl` module
972-
supports "External PSKs" in TLSv1.3, as described in RFC 9258.
952+
supports "External PSKs" in TLSv1.3, as described in :rfc:`9258`.
973953
(Contributed by Will Childs-Klein in :gh:`133624`.)
974954

975955
* Added new methods for managing groups used for SSL key agreement
@@ -1155,14 +1135,48 @@ tomllib
11551135

11561136

11571137
types
1158-
------
1138+
-----
11591139

11601140
* Expose the write-through :func:`locals` proxy type
11611141
as :data:`types.FrameLocalsProxyType`.
11621142
This represents the type of the :attr:`frame.f_locals` attribute,
11631143
as described in :pep:`667`.
11641144

11651145

1146+
typing
1147+
------
1148+
1149+
.. _whatsnew315-typeform:
1150+
1151+
* :pep:`747`: Add :data:`~typing.TypeForm`, a new special form for annotating
1152+
values that are themselves type expressions.
1153+
``TypeForm[T]`` means "a type form object describing ``T`` (or a type
1154+
assignable to ``T``)". At runtime, ``TypeForm(x)`` simply returns ``x``,
1155+
which allows explicit annotation of type-form values without changing
1156+
behavior.
1157+
1158+
This helps libraries that accept user-provided type expressions
1159+
(for example ``int``, ``str | None``, :class:`~typing.TypedDict`
1160+
classes, or ``list[int]``) expose precise signatures:
1161+
1162+
.. code-block:: python
1163+
1164+
from typing import Any, TypeForm
1165+
1166+
def cast[T](typ: TypeForm[T], value: Any) -> T: ...
1167+
1168+
(Contributed by Jelle Zijlstra in :gh:`145033`.)
1169+
1170+
* Code like ``class ExtraTypeVars(P1[S], Protocol[T, T2]): ...`` now raises
1171+
a :exc:`TypeError`, because ``S`` is not listed in ``Protocol`` parameters.
1172+
(Contributed by Nikita Sobolev in :gh:`137191`.)
1173+
1174+
* Code like ``class B2(A[T2], Protocol[T1, T2]): ...`` now correctly handles
1175+
type parameters order: it is ``(T1, T2)``, not ``(T2, T1)``
1176+
as it was incorrectly inferred in runtime before.
1177+
(Contributed by Nikita Sobolev in :gh:`137191`.)
1178+
1179+
11661180
unicodedata
11671181
-----------
11681182

@@ -1399,6 +1413,14 @@ Diego Russo in :gh:`140683` and :gh:`142305`.)
13991413
Removed
14001414
========
14011415

1416+
collections.abc
1417+
---------------
1418+
1419+
* :class:`collections.abc.ByteString` has been removed from
1420+
``collections.abc.__all__``. :class:`!collections.abc.ByteString` has been
1421+
deprecated since Python 3.12, and is scheduled for removal in Python 3.17.
1422+
1423+
14021424
ctypes
14031425
------
14041426

@@ -1475,26 +1497,9 @@ threading
14751497
typing
14761498
------
14771499

1478-
.. _whatsnew315-typeform:
1479-
1480-
* :pep:`747`: Add :data:`~typing.TypeForm`, a new special form for annotating
1481-
values that are themselves type expressions.
1482-
``TypeForm[T]`` means "a type form object describing ``T`` (or a type
1483-
assignable to ``T``)". At runtime, ``TypeForm(x)`` simply returns ``x``,
1484-
which allows explicit annotation of type-form values without changing
1485-
behavior.
1486-
1487-
This helps libraries that accept user-provided type expressions
1488-
(for example ``int``, ``str | None``, :class:`~typing.TypedDict`
1489-
classes, or ``list[int]``) expose precise signatures:
1490-
1491-
.. code-block:: python
1492-
1493-
from typing import Any, TypeForm
1494-
1495-
def cast[T](typ: TypeForm[T], value: Any) -> T: ...
1496-
1497-
(Contributed by Jelle Zijlstra in :gh:`145033`.)
1500+
* :class:`typing.ByteString` has been removed from ``typing.__all__``.
1501+
:class:`!typing.ByteString` has been deprecated since Python 3.9, and is
1502+
scheduled for removal in Python 3.17.
14981503

14991504
* The undocumented keyword argument syntax for creating
15001505
:class:`~typing.NamedTuple` classes (for example,
@@ -1508,33 +1513,6 @@ typing
15081513
or ``TD = TypedDict("TD", {})`` instead.
15091514
(Contributed by Bénédikt Tran in :gh:`133823`.)
15101515

1511-
* Code like ``class ExtraTypeVars(P1[S], Protocol[T, T2]): ...`` now raises
1512-
a :exc:`TypeError`, because ``S`` is not listed in ``Protocol`` parameters.
1513-
(Contributed by Nikita Sobolev in :gh:`137191`.)
1514-
1515-
* Code like ``class B2(A[T2], Protocol[T1, T2]): ...`` now correctly handles
1516-
type parameters order: it is ``(T1, T2)``, not ``(T2, T1)``
1517-
as it was incorrectly inferred in runtime before.
1518-
(Contributed by Nikita Sobolev in :gh:`137191`.)
1519-
1520-
* :class:`typing.ByteString` has been removed from ``typing.__all__``.
1521-
:class:`!typing.ByteString` has been deprecated since Python 3.9, and is
1522-
scheduled for removal in Python 3.17.
1523-
1524-
* The following statements now cause ``DeprecationWarning``\ s to be emitted at
1525-
runtime:
1526-
1527-
* ``from typing import ByteString``
1528-
* ``import typing; typing.ByteString``.
1529-
1530-
``DeprecationWarning``\ s were already emitted if :class:`typing.ByteString`
1531-
was subclassed or used as the second argument to :func:`isinstance` or
1532-
:func:`issubclass`, but warnings were not previously emitted if it was merely
1533-
imported or accessed from the :mod:`!typing` module.
1534-
1535-
* Deprecated :func:`!typing.no_type_check_decorator` has been removed.
1536-
(Contributed by Nikita Sobolev in :gh:`133601`.)
1537-
15381516

15391517
wave
15401518
----
@@ -1593,6 +1571,21 @@ New deprecations
15931571

15941572
(Contributed by Nikita Sobolev in :gh:`136355`.)
15951573

1574+
* :mod:`collections.abc`
1575+
1576+
* The following statements now cause ``DeprecationWarning``\ s to be emitted
1577+
at runtime:
1578+
1579+
* ``from collections.abc import ByteString``
1580+
* ``import collections.abc; collections.abc.ByteString``.
1581+
1582+
``DeprecationWarning``\ s were already emitted if
1583+
:class:`collections.abc.ByteString` was subclassed or used as the second
1584+
argument to :func:`isinstance` or :func:`issubclass`, but warnings were not
1585+
previously emitted if it was merely imported or accessed from the
1586+
:mod:`!collections.abc` module.
1587+
1588+
15961589
* :mod:`hashlib`:
15971590

15981591
* In hash function constructors such as :func:`~hashlib.new` or the
@@ -1616,6 +1609,22 @@ New deprecations
16161609

16171610
(Contributed by Sergey B Kirpichev and Serhiy Storchaka in :gh:`143715`.)
16181611

1612+
* :mod:`typing`:
1613+
1614+
* The following statements now cause ``DeprecationWarning``\ s to be emitted
1615+
at runtime:
1616+
1617+
* ``from typing import ByteString``
1618+
* ``import typing; typing.ByteString``.
1619+
1620+
``DeprecationWarning``\ s were already emitted if :class:`typing.ByteString`
1621+
was subclassed or used as the second argument to :func:`isinstance` or
1622+
:func:`issubclass`, but warnings were not previously emitted if it was
1623+
merely imported or accessed from the :mod:`!typing` module.
1624+
1625+
* Deprecated :func:`!typing.no_type_check_decorator` has been removed.
1626+
(Contributed by Nikita Sobolev in :gh:`133601`.)
1627+
16191628
* ``__version__``
16201629

16211630
* The ``__version__``, ``version`` and ``VERSION`` attributes have been

0 commit comments

Comments
 (0)