Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

E721: suggest reasonable alternative

オープン
#882 コメント 12 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

pycodestyle の単一の Python ファイルにある E721 checker のエントリーポイントから始め、このルールに対する既存のテストを調べてください。type(a) == type(b) と type(3) == int の両方を再現し、そのうえで意図する診断または代替動作を定義し、回帰テストで検証してください。

索引モデルが issue の本文から書いたものです。

説明

E721 is there to prevent type(3) == int in favour of isinstance(3, int). Thats fine.

But it also raises an error for code like type(a) == type(b). This is good code though and I don't know of a better way to test if two values have the same type. Of course you can go for isinstance(a, type(b)), but that is longer and less readable.

I suggest either changing E721 to not match lines like the above or to suggest a reasonable alternative to the line above.

主要言語
Python
スター
5.2k
フォーク
756
平均マージ
5時間 56分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PyCQA/pycodestyle のほかの issue

PyCQA/pycodestyle の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。