`abc.ABC.__slots__` should be marked with `ClassVar`

オープン
#15,364 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
devtools

調査の方向性

まず、abc.ABC を定義している typeshed のスタブを見つけ、slots が現在どのように宣言されているかを確認します。これを ClassVar[Sequence[str]] としてマークし、その後、リポジトリの関連する型チェックテストを使って、サブクラスが slots をインスタンス変数として扱わなくなっていることを検証します。

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

説明

According to the python official documentation, slots are class variables. Therefore, in the class abc.ABC, the variable __slots__ should be annotated as ClassVar[Sequence[str]]. There is currently no annotation. It means that in all subclasses of abc.ABC, the variable __slots__ is considered as an instance variable.

主要言語
Python
スター
5.1k
フォーク
2.1k
平均マージ
1日 13時間
マージ済み PR(30日)
73

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

python/typeshed のほかの issue

python/typeshed の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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