Skip to content

unidiomatic-typecheck only checks left-hand side #10217

@jacobtylerwalls

Description

@jacobtylerwalls

Bug description

# pylint: disable=missing-module-docstring, expression-not-assigned
type(1) == int
int == type(1)

Pylint output

************* Module a
a.py:2:0: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)

Expected behavior

************* Module a
a.py:2:0: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
a.py:3:0: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)

Pylint version

pylint 4.0.0-dev0
astroid 4.0.0-dev0
Python 3.13.1 (v3.13.1:06714517797, Dec  3 2024, 14:00:22) [Clang 15.0.0 (clang-1500.3.9.4)]

OS / Environment

No response

Additional dependencies

Metadata

Metadata

Assignees

Labels

False Negative 🦋No message is emitted but something is wrong with the codeGood first issueFriendly and approachable by new contributors

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions