Skip to content

Detect the same if conditions #2241

@sobolevn

Description

@sobolevn

Today I saw this code:

if isinstance(x, int):
    ...
elif isinstance(x, str):
    ...
elif isinstance(x, int): ...

The thing is that isinstance(x, int) is duplicated. And the second branch won't ever be called.

We need to detecct this kind of problems and report them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions