Skip to content

isinstance(x, Type) not accepted #3060

Open
@JukkaL

Description

@JukkaL

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions