PEP 646: Add forgotten parameter name in examples (#2837)

This commit is contained in:
Pavel Karateev 2022-10-20 21:51:08 +03:00 committed by GitHub
parent 71daa07244
commit 759a6bd547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1180,7 +1180,7 @@ We can attach names to each parameter using normal type variables:
K = TypeVar('K')
N = TypeVar('N')
def matrix_vector_multiply(x: Array[K, N], Array[N]) -> Array[K]: ...
def matrix_vector_multiply(x: Array[K, N], y: Array[N]) -> Array[K]: ...
a: Array[Literal[64], Literal[32]]
b: Array[Literal[32]]
@ -1255,7 +1255,7 @@ without knowing the type ahead of time. For example, we can still write:
K = TypeVar('K')
N = TypeVar('N')
def matrix_vector_multiply(x: Array[K, N], Array[N]) -> Array[K]: ...
def matrix_vector_multiply(x: Array[K, N], y: Array[N]) -> Array[K]: ...
We can then use this with: