From 168ae47d0ca5801b275fcc659f1542f64169c496 Mon Sep 17 00:00:00 2001 From: johnjhawk Date: Sun, 14 Nov 2021 06:49:14 -0800 Subject: [PATCH] PEP 483: fixes issue of getting wrong Error Need to use the parameters provided to get to Error that is suggested in the comments. --- pep-0483.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pep-0483.txt b/pep-0483.txt index 97cfcaef422..35ae23d6771 100644 --- a/pep-0483.txt +++ b/pep-0483.txt @@ -486,7 +486,7 @@ replaced by the most-derived base class among ``t1``, etc. Examples: Note that the type checker will reject this function:: 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 one should use constrained type variables.