PEP 483: Fix an example (#2143)

The body of one of the examples mistakenly used different names than the parameters given in the function signature.
This commit is contained in:
johnjhawk 2021-11-14 14:39:30 -08:00 committed by GitHub
parent 7d90a862cb
commit 4109619130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -486,7 +486,7 @@ replaced by the most-derived base class among ``t1``, etc. Examples:
Note that the type checker will reject this function:: Note that the type checker will reject this function::
def concat(first: U, second: U) -> U: def concat(first: U, second: U) -> U:
return x + y # Error: can't concatenate str and bytes return first + second # Error: can't concatenate str and bytes
For such cases where parameters could change their types only simultaneously For such cases where parameters could change their types only simultaneously
one should use constrained type variables. one should use constrained type variables.