How to handle keyword-only arguments
维护者通常 1 天内回复
@bluetech 已经在做这个了。
开始于 2026年9月25日。
评估
这个 Issue 还没有评估数据。
描述
Currently pluggy ignores keyword-only arguments in specs and impls.
The reason historically is that _multicall only called hookimpls using positional arguments (tuple) as an optimization(?), but keyword-only arguments can't be passed positionally.
Since 51ec4486b9d47da944725b0326a412cf9b7518bf however, if a hookimpl function declares a default then we do pass kwargs, so it's possible to support keyword-only.
For specs, supporting keyword-only is less of an issue, since it's not actually called, so it doesn't actually matter.
In pluggy callers are required to pass parameters by keyword so keyword-only or not doesn't make a difference.
Overall, there is no reason to define a keyword-only parameter in either spec or impl, it only has a downside of making calls a bit slower. But I think the current situation where they're just ignored is not very nice. So we can go with either of these:
- Support them.
- Reject them (validation).
Since "Support them" is a small performance trap, it seems like 2 is better, unless we can make the performance equivalent, which I will look into.
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 170
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 18
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pytest-dev/pluggy 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 85/100
pytest-dev/pluggy#757 ·
维护者通常 1 天内回复
-
[Downstream] devpi broken - trying to register `None`可能已有人在做 @bluetech 于 7 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 58/100
pytest-dev/pluggy#749 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
pytest-dev/pluggy#705 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 20/100
pytest-dev/pluggy#628 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
pytest-dev/pluggy#588 · 1 个 reaction ·
维护者通常 1 天内回复
查看 pytest-dev/pluggy 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 85/100
epam/ai-dial-quickapps-backend#628 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 69/100
timqian/chinese-independent-blogs#2235 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
eclipse-score/coverage_tool#27 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
bojieli/ai-agent-book#1174 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
RedHatQE/mtv-api-tests#721 ·
维护者通常 1 天内回复