Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP 675: Establish typing context in the Abstract #2324

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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