Skip to content

Commit 47e2ca8

Browse files
authored
Fix proper_plugin for typeshed tuple change (#12319)
This will be broken by python/typeshed#7454 Co-authored-by: hauntsaninja <>
1 parent 18c32da commit 47e2ca8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

misc/proper_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from mypy.plugin import Plugin, FunctionContext
22
from mypy.types import (
3-
Type, Instance, CallableType, UnionType, get_proper_type, ProperType,
3+
FunctionLike, Type, Instance, CallableType, UnionType, get_proper_type, ProperType,
44
get_proper_types, TupleType, NoneTyp, AnyType
55
)
66
from mypy.nodes import TypeInfo
@@ -52,7 +52,7 @@ def isinstance_proper_hook(ctx: FunctionContext) -> Type:
5252

5353
def is_special_target(right: ProperType) -> bool:
5454
"""Whitelist some special cases for use in isinstance() with improper types."""
55-
if isinstance(right, CallableType) and right.is_type_obj():
55+
if isinstance(right, FunctionLike) and right.is_type_obj():
5656
if right.type_object().fullname == 'builtins.tuple':
5757
# Used with Union[Type, Tuple[Type, ...]].
5858
return True

0 commit comments

Comments
 (0)