FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-109190: Copyedit 3.12 What's New: Typing PEPs by AA-Turner · Pull Request #109659 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 6 additions & 4 deletions Doc/whatsnew/3.12.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ See :mod:`sys.monitoring` for details.
New Features Related to Type Hints
==================================

This section covers major changes affecting :pep:`484` type hints and
This section covers major changes affecting :pep:`type hints <484>` and
the :mod:`typing` module.

.. _whatsnew312-pep692:
Expand All @@ -345,7 +345,7 @@ Typing ``**kwargs`` in a function signature as introduced by :pep:`484` allowed
for valid annotations only in cases where all of the ``**kwargs`` were of the
same type.

This PEP specifies a more precise way of typing ``**kwargs`` by relying on
:pep:`692` specifies a more precise way of typing ``**kwargs`` by relying on
typed dictionaries::

from typing import TypedDict, Unpack
Expand Down Expand Up @@ -389,6 +389,8 @@ Example::
def get_colour(self) -> str:
return "red"

See :pep:`698` for more details.

(Contributed by Steven Troxler in :gh:`101561`.)

.. _whatsnew312-pep695:
Expand Down Expand Up @@ -434,8 +436,8 @@ parameters with bounds or constraints::

The value of type aliases and the bound and constraints of type variables
created through this syntax are evaluated only on demand (see
:ref:`lazy-evaluation`). This means type aliases are able to refer to other
types defined later in the file.
:ref:`lazy evaluation <lazy-evaluation>`). This means type aliases are able to
refer to other types defined later in the file.

Type parameters declared through a type parameter list are visible within the
scope of the declaration and any nested scopes, but not in the outer scope. For
Expand Down

Back | FazBrowse Home | New Git URL