Avoid relying on `typing.TYPE_CHECKING` to the maximum possible extent
まだ誰も着手していません。
- 主要言語
- Cython
- スター
- 3.4k
- フォーク
- 329
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 116
説明
During investigation of #454 and related doc rendering issues, it has come to my attention that the type checking detection logic does not work well with Sphinx (ex: https://github.com/sphinx-doc/sphinx/issues/13137, https://github.com/sphinx-doc/sphinx/issues/11225).
Independently, Ralf has pointed out that it makes code debugging harder (https://github.com/NVIDIA/cuda-python/pull/463#discussion_r1967029167).
The idea of having a if TYPE_CHECKING: check is to avoid unnecessary imports or circular imports. If such issues do not exist, we should avoid using it.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、#454 に関係する TYPE_CHECKING の使用箇所と、関連する Sphinx の issue を確認し、不要な import や循環 import を防いでいる guard を特定します。これらの import が Sphinx のレンダリングとデバッグにどのような影響を与えるかを確認します。不要な TYPE_CHECKING guard が削除され、import の安全性に必要な guard が残っていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- developer-experience, documentation
- issue の種類
- リファクタリング
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 42/100