pyright says that type of cattrs.preconf.json.make_converter is partially unknown
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by inspecting Converter.Init and the unstruct_collection_overrides annotation, then trace how cattrs.preconf.json.make_converter() uses it. Compare the annotation with UnstructureHookT and verify that the reported partially unknown type is resolved without changing the converter's behavior.
由索引模型根据 Issue 内容生成。
描述
Pyright flags the code below with "Type of "make_converter" is partially unknown".
converter = cattrs.preconf.json.make_converter()
The problem is the type of the parameter unstruct_collection_overrides: Mapping[type, (...) -> Unknown].
Poking around in the cattrs code, this error can be resolved by changing the type of unstruct_collection_overrides in Converter.Init from
unstruct_collection_overrides: Mapping[type, Callable] = {}
to
unstruct_collection_overrides: Mapping[type, UnstructureHookT] = {}
- 主要语言
- Python
- 星标
- 1.1k
- 派生
- 165
- 平均合并
- 16 小时 19 分钟
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-attrs/cattrs 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
python-attrs/cattrs#761 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
python-attrs/cattrs#513 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 35/100
python-attrs/cattrs#779 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 85/100
python-attrs/cattrs#774 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
python-attrs/cattrs#746 · 2 条评论 ·
维护者通常 1 天内回复
查看 python-attrs/cattrs 的全部 Issue
相似的 Issue
-
namespace operations
难度 1/5 1 小时以内 新手友好度 82/100
EclipseFdn/open-vsx.org#13573 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
collective/icalendar#1854 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
rancher/rancher-ai-agent#412 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
TUDelftGeodesy/DePSI#134 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
HenriquesLab/rxiv-maker#335 ·