Avoid relying on `typing.TYPE_CHECKING` to the maximum possible extent
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 重构
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- python
调研方向
首先检查 #454 涉及的 TYPE_CHECKING 使用方式以及相关的 Sphinx issue,然后确定哪些 guard 可以防止不必要的 import 或循环 import。检查这些 import 如何影响 Sphinx 渲染和调试。当不必要的 TYPE_CHECKING guard 被移除,同时保留导入安全所需的 guard 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Cython
- 星标
- 3.4k
- 派生
- 329
- 平均合并
- 1 天 21 小时
- 30 天内合并 PR
- 113
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/cuda-python 的其他 Issue
-
bug cuda.core
难度 2/5 1-3 小时 新手友好度 76/100
NVIDIA/cuda-python#2886 · 1 条评论 ·
-
triage
难度 1/5 1 小时以内 新手友好度 88/100
NVIDIA/cuda-python#2717 ·
-
triage
难度 1/5 1-3 小时 新手友好度 90/100
NVIDIA/cuda-python#2712 ·
-
triage
难度 2/5 1-3 小时 新手友好度 82/100
NVIDIA/cuda-python#2646 · 1 个 reaction ·
-
cuda.core triage
难度 2/5 1-3 小时 新手友好度 62/100
NVIDIA/cuda-python#2435 · 1 条评论 ·
查看 NVIDIA/cuda-python 的全部 Issue
相似的 Issue
-
comp/cron P2 sweeper:risk-automation type/bug
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#117792 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
bancolombia/sentinel#20 ·
-
optimization optimization:agents-md-curator
难度 2/5 1-3 小时 新手友好度 86/100
githubnext/gh-aw-cao#13143 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
-
chore
难度 2/5 1-3 小时 新手友好度 85/100
alunduil/woodland-generators#669 ·