Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Flag unidiomatic-typecheck for type(x) is type(y)#10372

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alexprabhat99 wants to merge3 commits intopylint-dev:main
base:main
Choose a base branch
Loading
fromalexprabhat99:bugfix-10365

Conversation

alexprabhat99
Copy link
Contributor

Type of Changes

Type
🐛 Bug fix

Description

Closes#10365

@Pierre-SassoulasPierre-Sassoulas added this to the4.0.0 milestoneMay 6, 2025
@github-actionsGitHub Actions
Copy link
Contributor

🤖Effect of this PR on checked open source code: 🤖

Effect onhome-assistant:
The following messages are now emitted:

  1. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/home-assistant/core/blob/0bf807b96e771f855deeaa5d44008f7bf8eac771/homeassistant/helpers/entity.py#L338

Effect onmusic21:
The following messages are now emitted:

  1. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/cuthbertLab/music21/blob/599c5c4128c09d7cee0be077a794326b82b68839/music21/duration.py#L1771
  2. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/cuthbertLab/music21/blob/599c5c4128c09d7cee0be077a794326b82b68839/music21/metadata/primitives.py#L499
  3. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/cuthbertLab/music21/blob/599c5c4128c09d7cee0be077a794326b82b68839/music21/metadata/primitives.py#L898
  4. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/cuthbertLab/music21/blob/599c5c4128c09d7cee0be077a794326b82b68839/music21/metadata/primitives.py#L915
  5. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/cuthbertLab/music21/blob/599c5c4128c09d7cee0be077a794326b82b68839/music21/metadata/primitives.py#L1011
  6. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/cuthbertLab/music21/blob/599c5c4128c09d7cee0be077a794326b82b68839/music21/metadata/primitives.py#L1197
  7. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/cuthbertLab/music21/blob/599c5c4128c09d7cee0be077a794326b82b68839/music21/tree/spans.py#L91
  8. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/cuthbertLab/music21/blob/599c5c4128c09d7cee0be077a794326b82b68839/music21/common/objects.py#L258

Effect onpytest:
The following messages are now emitted:

  1. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pytest-dev/pytest/blob/89b84cb56295c46e1d8834b599e858bc65c15a5b/src/_pytest/assertion/util.py#L263

Effect ondjango:
The following messages are now emitted:

  1. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/django/django/blob/1fb3f57e81239a75eb8f873b392e11534c041fdc/django/db/migrations/operations/models.py#L683

Effect onpandas:
The following messages are now emitted:

  1. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/generic.py#L9301
  2. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/arrays/masked.py#L1108
  3. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/arrays/interval.py#L337
  4. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/arrays/interval.py#L992
  5. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/arrays/_mixins.py#L175
  6. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/arrays/base.py#L1510
  7. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/arrays/arrow/extension_types.py#L43
  8. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/arrays/arrow/extension_types.py#L97
  9. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/indexes/base.py#L5545
  10. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/pandas-dev/pandas/blob/7bb58a82d444fa4d672a484180c567b17bed5da4/pandas/core/internals/concat.py#L465

Effect onsentry:
The following messages are now emitted:

  1. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/getsentry/sentry/blob/e6287c10d05a093cec48a4b7dc27420279eb3f37/src/sentry/tagstore/types.py#L26
  2. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/getsentry/sentry/blob/e6287c10d05a093cec48a4b7dc27420279eb3f37/src/sentry/apidocs/spectacular_ports.py#L146

Effect onpsycopg:
The following messages are now emitted:

  1. unidiomatic-typecheck:
    Use isinstance() rather than type() for a typecheck.
    https://github.com/psycopg/psycopg/blob/4ab4c02ef8cde95c5e79703cc47d6676426f6d08/psycopg/psycopg/sql.py#L102

This comment was generated for commitec62635

@Pierre-SassoulasPierre-Sassoulas added the Needs decision 🔒Needs a decision before implemention or rejection labelMay 6, 2025
@jacobtylerwalls
Copy link
Member

Cool stuff@alexprabhat99! We're still discussing the merit of the idea, but I'm wondering if you'd be game to try to add some sort of exception for calls insidedef __eq__(self, other)? If we can filter those out, we might get a much better analysis from the primer. Ta!

Pierre-Sassoulas reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Needs decision 🔒Needs a decision before implemention or rejection
Projects
None yet
Milestone
4.0.0
Development

Successfully merging this pull request may close these issues.

unidiomatic-typecheck not flagged for type(x) is type(y)
3 participants
@alexprabhat99@jacobtylerwalls@Pierre-Sassoulas

[8]ページ先頭

©2009-2025 Movatter.jp