From 85f6001c06cc779512d6eed268df52e75ee4fc7e Mon Sep 17 00:00:00 2001 From: hauntsaninja <> Date: Tue, 8 Mar 2022 23:24:13 -0800 Subject: [PATCH] Fix proper_plugin for typeshed tuple change This will be broken by https://github.com/python/typeshed/pull/7454 --- misc/proper_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/proper_plugin.py b/misc/proper_plugin.py index 249ad983266b..acd77500cd5d 100644 --- a/misc/proper_plugin.py +++ b/misc/proper_plugin.py @@ -1,6 +1,6 @@ from mypy.plugin import Plugin, FunctionContext from mypy.types import ( - Type, Instance, CallableType, UnionType, get_proper_type, ProperType, + FunctionLike, Type, Instance, CallableType, UnionType, get_proper_type, ProperType, get_proper_types, TupleType, NoneTyp, AnyType ) from mypy.nodes import TypeInfo @@ -52,7 +52,7 @@ def isinstance_proper_hook(ctx: FunctionContext) -> Type: def is_special_target(right: ProperType) -> bool: """Whitelist some special cases for use in isinstance() with improper types.""" - if isinstance(right, CallableType) and right.is_type_obj(): + if isinstance(right, FunctionLike) and right.is_type_obj(): if right.type_object().fullname == 'builtins.tuple': # Used with Union[Type, Tuple[Type, ...]]. return True