Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Plugin registry compares plugins by equality, not identity

未关闭 适合新手
#760 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@00200200 已经在做这个了。

开始于 2026年10月11日。

  • #768 来自 @CaramelizedCUDA —— 已关闭,未合并
  • #770 来自 @himanshu748 —— 已关闭,未合并
  • #773 来自 @anon5376 —— 已关闭,未合并
  • #777 来自 @00200200 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
tooling

调研方向

从插件管理器中的register()、get_name()和is_registered()开始,它们使用==或in对_name2plugin的值进行插件比较,并将其与已经使用is的get_hookcallers()进行比较。使用issue中两个dataclass实例的示例进行复现,然后将比较改为同一性比较。完成标准是:两个相等但不同的插件对象可以以不同名称注册,并且现有测试套件仍然通过。

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

描述

🤖 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.

register() (plugin in self._name2plugin.values()), get_name() and is_registered() use ==, while get_hookcallers() uses is. Two distinct plugins that compare equal are treated as one:

@dataclass
class P:
    @hookimpl
    def myhook(self): ...

pm.register(P(), "one")
pm.register(P(), "two")  # ValueError: Plugin already registered under a different name

Proposal: use identity everywhere. Small behavior change for plugins with a custom __eq__.

Found while working on #759.

主要语言
Python
星标
1.7k
派生
187
平均合并
1 天 20 小时
30 天内合并 PR
24

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

pytest-dev/pluggy 的其他 Issue

查看 pytest-dev/pluggy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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