Skip to content

Commit

Permalink
pythongh-91491: Complete Whats New in 3.11 for typing
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed May 12, 2022
1 parent 1a9645f commit 0a9eb32
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,12 @@ For major changes, see :ref:`new-feat-related-type-hints-311`.
the given type. At runtime it simply returns the received value.
(Contributed by Jelle Zijlstra in :gh:`90638`.)

* :data:`typing.TypedDict` subclasses can now be generic. (Contributed by
Samodya Abey in :gh:`89026`.)

* :class:`~typing.NamedTuple` subclasses can now be generic.
(Contributed by Serhiy Storchaka in :issue:`43923`.)

* Allow subclassing of :class:`typing.Any`. This is useful for avoiding
type checker errors related to highly dynamic class, such as mocks.
(Contributed by Shantanu Jain in :gh:`91154`.)
Expand All @@ -739,11 +745,34 @@ For major changes, see :ref:`new-feat-related-type-hints-311`.
to clear all registered overloads of a function.
(Contributed by Jelle Zijlstra in :gh:`89263`.)

* :data:`typing.TypedDict` subclasses can now be generic. (Contributed by
Samodya Abey in :gh:`89026`.)
* The :meth:`__init__` method of :class:`~typing.Protocol` subclasses
is now preserved. (Contributed by Adrian Garcia Badarasco in :gh:`88970`.)

* :class:`~typing.NamedTuple` subclasses can now be generic.
(Contributed by Serhiy Storchaka in :issue:`43923`.)
* The representation of empty tuple types (``Tuple[()]``) is simplified.
(Contributed by Serhyi Storchaka in :gh:`91137`.)

* Loosen runtime requirements for type annotations by removing the callable
check in the private ``typing._type_check`` function. (Contributed by
Gregory Beauregard in :gh:`90802`.)

* :func:`typing.get_type_hints` now supports evaluating strings as forward
references in :ref:`PEP 585 generic aliases <types-genericalias>`.
(Contributed by Niklas Rosenstein in :gh:`85542`.)

* :func:`typing.get_type_hints` no longer adds :data:`~typing.Optional`
to parameters with ``None`` as a default. (Contributed by Nikita Sobolev
in :gh:`90353`.)

* :func:`typing.get_type_hints` now supports evaluating bare stringified
:data:`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard
in :gh:`90711`.)

* :func:`typing.no_type_check` no longer modifies external classes and functions.
It also now correctly marks classmethods as not to be type checked. (Contributed
by Nikita Sobolev in :gh:`90729`.)

* The keyword argument syntax for constructing :data:`~typing.TypedDict` types
is now deprecated. (Contributed by Jingchen Ye in :gh:`90224`.)


tkinter
Expand Down

0 comments on commit 0a9eb32

Please sign in to comment.