From d81d1b8a55eaff27b9417a8d91ce649fd02be611 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 3 Nov 2021 18:47:22 +0300 Subject: [PATCH 1/2] Fix bug with `param_kind` compare with `ARG_NAMED` --- mypy/semanal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/semanal.py b/mypy/semanal.py index 1c87d9721f42..8608ed4bc493 100644 --- a/mypy/semanal.py +++ b/mypy/semanal.py @@ -3111,7 +3111,7 @@ def process_typevar_parameters(self, args: List[Expression], contravariant = False upper_bound: Type = self.object_type() for param_value, param_name, param_kind in zip(args, names, kinds): - if not param_kind == ARG_NAMED: + if not param_kind.is_named():: self.fail("Unexpected argument to TypeVar()", context) return None if param_name == 'covariant': From ec0bb663239b2664bf6fcb4ffa05e941254ef1b4 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 3 Nov 2021 18:48:57 +0300 Subject: [PATCH 2/2] Update semanal.py --- mypy/semanal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/semanal.py b/mypy/semanal.py index 8608ed4bc493..c6e3655331cd 100644 --- a/mypy/semanal.py +++ b/mypy/semanal.py @@ -3111,7 +3111,7 @@ def process_typevar_parameters(self, args: List[Expression], contravariant = False upper_bound: Type = self.object_type() for param_value, param_name, param_kind in zip(args, names, kinds): - if not param_kind.is_named():: + if not param_kind.is_named(): self.fail("Unexpected argument to TypeVar()", context) return None if param_name == 'covariant':