Skip to content

type-comparison (E721) doesn't work when comparing against an actual type #6260

@DetachHead

Description

@DetachHead
foo = 1
if type(foo) is int: # no error
    ...
if type(foo) is type(1): # error
    ...

the pylint rule unidiomatic-typecheck catches both cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions