Skip to content

Commit

Permalink
PEP 675; Establish typing context in the Abstract (#2324)
Browse files Browse the repository at this point in the history
  • Loading branch information
encukou authored Feb 15, 2022
1 parent bdc0e44 commit ba2a929
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pep-0675.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ Post-History:
Abstract
========

There is currently no way to specify that a function parameter can be
of any literal string type; we have to specify the precise literal
string, such as ``Literal["foo"]``. This PEP introduces a supertype of
literal string types: ``LiteralString``. This allows a function to
accept arbitrary literal string types, such as ``Literal["foo"]`` or
Using static type annotations, there is currently no way to specify
that a function parameter can be of any literal string type.
We have to specify the precise literal string, such as
``Literal["foo"]``. This PEP introduces a supertype of literal string
types: ``LiteralString``. This allows a function to accept arbitrary
literal string types, such as ``Literal["foo"]`` or
``Literal["bar"]``.


Expand Down

0 comments on commit ba2a929

Please sign in to comment.