PEP 675; Establish typing context in the Abstract (#2324)
This commit is contained in:
parent
bdc0e44c67
commit
ba2a9295dd
11
pep-0675.rst
11
pep-0675.rst
|
@ -15,11 +15,12 @@ Post-History:
|
||||||
Abstract
|
Abstract
|
||||||
========
|
========
|
||||||
|
|
||||||
There is currently no way to specify that a function parameter can be
|
Using static type annotations, there is currently no way to specify
|
||||||
of any literal string type; we have to specify the precise literal
|
that a function parameter can be of any literal string type.
|
||||||
string, such as ``Literal["foo"]``. This PEP introduces a supertype of
|
We have to specify the precise literal string, such as
|
||||||
literal string types: ``LiteralString``. This allows a function to
|
``Literal["foo"]``. This PEP introduces a supertype of literal string
|
||||||
accept arbitrary literal string types, such as ``Literal["foo"]`` or
|
types: ``LiteralString``. This allows a function to accept arbitrary
|
||||||
|
literal string types, such as ``Literal["foo"]`` or
|
||||||
``Literal["bar"]``.
|
``Literal["bar"]``.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue