multiformats / multiformats/py-multihash
Refactor: Remove legacy pymultihash backward compatibility APIs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 17
- Forks
- 17
- Avg merge
- 1h 5m
- Merged PRs (30d)
- 3
Description
Description
The py-multihash repository currently retains backwards-compatible APIs and constructor patterns originally introduced to facilitate migration from the legacy pymultihash package. As these compatibility layers have served their purpose and are now obsolete, this issue proposes their complete removal to streamline the codebase and improve long-term maintainability.
Proposed Changes
- Remove Legacy Constructor: Remove the 2-argument constructor
Multihash(func, digest)fallback from theMultihashobject. - Enforce Canonical Initialization: Revert
Multihashto standardnamedtuplebehavior using strictly(code, name, length, digest). - Refactor Internal Helpers: Update
digest()andsum_stream()helper functions to explicitly compute and construct theMultihashobject using the canonical(code, name, length, digest)signature. - Test Suite Updates: Remove corresponding test cases that checked the legacy initialization style.
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 Multihash object and the digest() and sum_stream() helpers in the py-multihash repository, then find tests covering the legacy initialization style. Verify the canonical (code, name, length, digest) initialization path and update the affected tests. Done means the two-argument constructor is no longer supported and the test suite passes with the helper changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100