-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctlytopic-type-narrowingConditional type narrowing / binderConditional type narrowing / bindertopic-usability
Description
isinstance(x, Type)
generates in an error, even though it should probably be considered equivalent to isinstance(x, type)
. Example:
from typing import Type
def f(x: Type[int]) -> None:
if isinstance(x, Type): # Argument 2 to "isinstance" has incompatible type "object";
# expected "Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]"
pass
glyph, isheff, ddriddle, sed-i, sueskind and 1 more
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-1-normaltopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctlytopic-type-narrowingConditional type narrowing / binderConditional type narrowing / bindertopic-usability