Skip to content

unidiomatic-typecheck only checks left-hand side #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zchn opened this issue Mar 20, 2025 · 3 comments · May be fixed by #16, #5, #6 or #7
Open

unidiomatic-typecheck only checks left-hand side #3

zchn opened this issue Mar 20, 2025 · 3 comments · May be fixed by #16, #5, #6 or #7

Comments

@zchn
Copy link

zchn commented Mar 20, 2025

Bug description

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

Configuration

Command used

pylint a.py

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

@zchn
Copy link
Author

zchn commented Apr 26, 2025

@snipr-ben snipe it please

@snipr-ben
Copy link

Pull request created: #16

@zchn
Copy link
Author

zchn commented Apr 27, 2025

original issue number is 10217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment