Skip to content

Display oids in same format as ZODB.utils.oid_repr #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

perrinjerome
Copy link

Fixes #219

@icemac icemac requested review from d-maurer, dataflake and Copilot June 4, 2025 14:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the representation of persistent object OIDs to follow the same format as ZODB’s oid_repr. The changes include adding a new test for short, odd-length OIDs in Python, introducing an oid_repr helper in Python to format OIDs, updating the C implementation to apply similar zero-padding logic, and documenting the change in CHANGES.rst.

  • Added test case test_short_odd_oid in tests.
  • Created Python helper function oid_repr for OID formatting.
  • Updated C code in cPersistence.c to mirror the Python zero-padding behavior.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/persistent/tests/test_persistence.py Added test to validate short OID representation
src/persistent/persistence.py Introduced oid_repr function for OID formatting
src/persistent/cPersistence.c Updated C implementation to apply zero-padding
CHANGES.rst Documented the oid_repr formatting update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

persistent.Persistent.__repr__ displays oids incompatible with repr_to_oid
2 participants