python / python/typeshed

Distribute stdlib types as types-stdlib

未关闭
#5,835 10 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

project: policy
主要语言
Python
星标
5.1k
派生
2.1k
平均合并
1 天 19 小时
30 天内合并 PR
82

描述

This has been briefly discussed before, but I think it would be a good idea if we started distributing the stdlib types in a separate package types-stdlib, similar to third-party packages:

  • Type checkers could optionally depend on (a specific version of) that package, instead of shipping their own copy, reducing coupling and arguably improving maintainability.
  • Third-party stubs could require a minimum version of the types-stdlib package, for example if they are relying on _typeshed features or for cases like #5762. Type checkers that opt to distribute a copy of the stdlib, could warn if incompatible stubs are used.

Technical considerations:

  • The versioning scheme would be similar to third-party stubs, e.g. types-stdlib 3.10.X, where X is incremented automatically. We should probably increment the version number as soon as the first beta is released and we are reasonably sure we have added all new/changed API.
  • The stubs would be installed into a special directory, for example stdlib, or even a non-importable name like types-stdlib (so we'd have stubs stdlib/sys.pyi etc.) so that they are only used by type checkers that support this package and don't interfere.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先审阅 issue 讨论以及之前链接的上下文,因为其中没有指定文件、测试或入口点。在实现之前,确定包布局、版本方案、安装行为和兼容性预期;完成的要求是就设计达成一致,并为 stdlib stubs 提供完整的分发路径。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。