F822 (flake8): Type-only definitions in stubs and __all__
还没有人认领这个 Issue。
评估
调研方向
首先使用 pyflakes 重现报告中的代码片段,然后跟踪 all 和带注解名称的检查方式。确定是否应更改对 stub 文件的处理,同时不抑制常规 Python 文件中的真实运行时错误;当预期情况得到处理且现有行为仍由测试覆盖时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
I am not sure if this is something that should be fixed in pyflakes as it only concerns stub files and is a genuine error in Python files. Please consider:
__all__ = ["foo"]
foo: int
This reports undefined name 'foo' in __all__. This is true at runtime, although this example is still useful for stubs. (flake8 3.7.9, pyflakes 2.1.1)
- 主要语言
- Python
- 星标
- 1.5k
- 派生
- 205
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 5
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PyCQA/pyflakes 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 2/5 1-3 小时 新手友好度 52/100
-
Use of await in a function that is not async should be shown as a syntax error by flake8可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 45/100
-
难度 5/5 一周以上 新手友好度 25/100
相似的 Issue
-
kind/bug priority/medium qa_automation
难度 2/5 1-3 小时 新手友好度 78/100
yugabyte/yugabyte-db#37324 ·
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 87/100
btclib-org/btclib-node#2260 ·
维护者通常 1 天内回复
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)可能已有人在做 @geyazheng 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
langchain-ai/langchain-aws#1469 ·
维护者通常 1 天内回复
-
GCToggler leaves collection enabled if the body re-enables it可能已有人在做 @Gambit-Checkmate 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 7 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复