Type annotations for public API would be nice

未关闭
#798 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 7 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
一周以上
新手友好度
22/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
api, tooling

调研方向

The payload names no specific modules, so the public API surface must be identified first, for example by running Pyright's --verifytypes check the issue suggests to get a baseline of untyped symbols. Annotating those symbols and then adding an empty py.typed marker to the package is the intended change. Done means the chosen public API passes the type-completeness check and the marker ships with the package. The issue has no comments or maintainer decision on scope, so confirm the surface before starting.

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

描述

Is your feature request related to a problem? Please describe.
Most of the project's public API lacks static type annotations and consequently there is also no py.typed marker that signals to library consumers that their usages of these APIs may be type checked.

Describe the solution you'd like
It would be nice if at least the public API of this project was fully statically typed and then a py.typed marker added so that dependent projects can check that their usages of this library are correct, get type-based IDE autocompletion etc.

Describe alternatives you've considered

  • Wait for a 3rd party to publish a type stubs package. But there already are some type hints in Rope's codebase, so I don't see the point.

Additional context

  • API docs as suggested in #796 would also greatly benefit from type annotations.
  • Pyright's --verifytypes option may be used to check if the public interface is in fact "type complete". Mypy might have something similar in the form of coverage reports.
主要语言
Python
星标
2.2k
派生
197
平均合并
2 天 13 小时
30 天内合并 PR
5

环境准备

从这里开始

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

python-rope/rope 的其他 Issue

查看 python-rope/rope 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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