Suggestion: have repr(oid) be `Oid(hex='a1b2c3')` instead of `a1b2c3`
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Python Oid implementation and its repr behavior, then inspect nearby tests for Oid string representations. Update the representation so it is a valid Oid(hex='...') expression and confirm the existing representation tests cover the new output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100