libgit2 / libgit2/pygit2

Suggestion: have repr(oid) be `Oid(hex='a1b2c3')` instead of `a1b2c3`

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

还没有人认领这个 Issue。

主要语言
Python
星标
1.7k
派生
408
平均合并
2 天 57 分钟
30 天内合并 PR
7

描述

I suggest to make the repr of Oid objects be:

Oid(hex='a1b2c3')

instead of

a1b2c3

I think that it's better if repr returns a valid python expression. It's clearer what the object is, and it makes it easier to reconstruct it.

I can probably submit a pull request if this is approved.

Thanks!
Noam

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先定位 Python Oid 的实现及其 repr 行为,然后检查附近关于 Oid 字符串表示的测试。更新该表示,使其成为有效的 Oid(hex='...') 表达式,并确认现有的表示测试覆盖新的输出。

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

评估

技术栈
python
领域
api
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
活跃
描述清晰度
基本清楚
新手友好度
72/100

把新 issue 发到你的邮箱

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