Skip to content

isinstance(x, CallableType) and x.is_type_object() is a code smell #12320

Open
@hauntsaninja

Description

@hauntsaninja

While fixing #12319 I noticed that if you grep for is_type_object, there are several instances where only CallableTypes are handled. Presumably, these all do the wrong thing for types with overloaded __new__.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongrefactoringChanging mypy's internalstopic-developerIssues relevant to mypy developers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions