PEP 696: Add note about lazy eval with PEP 695 (#3145)
This commit is contained in:
parent
15f8e2810b
commit
b9bbe0e4d6
10
pep-0696.rst
10
pep-0696.rst
|
@ -413,9 +413,9 @@ Pyright currently supports this functionality.
|
|||
Interaction with PEP 695
|
||||
------------------------
|
||||
|
||||
If this PEP is accepted, the syntax proposed in :pep:`695` will be
|
||||
extended to introduce a way to specify defaults for type parameters
|
||||
using the "=" operator inside of the square brackets like so:
|
||||
The syntax proposed in :pep:`695` will be extended to introduce a way
|
||||
to specify defaults for type parameters using the "=" operator inside
|
||||
of the square brackets like so:
|
||||
|
||||
.. code-block:: py
|
||||
|
||||
|
@ -434,6 +434,10 @@ using the "=" operator inside of the square brackets like so:
|
|||
type Qux[*Ts = *tuple[str]] = Ham[*Ts]
|
||||
type Rab[U, T = str] = Bar[T, U]
|
||||
|
||||
:ref:`Similarly to the bound for a type parameter <695-scoping-behavior>`,
|
||||
defaults should be lazily evaluated, with the same scoping rules to
|
||||
avoid the unnecessary usage of quotes around them.
|
||||
|
||||
This functionality was included in the initial draft of :pep:`695` but
|
||||
was removed due to scope creep.
|
||||
|
||||
|
|
Loading…
Reference in New Issue