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 the Multihash object.
- Enforce Canonical Initialization: Revert
Multihash to standard namedtuple behavior using strictly (code, name, length, digest).
- Refactor Internal Helpers: Update
digest() and sum_stream() helper functions to explicitly compute and construct the Multihash object using the canonical (code, name, length, digest) signature.
- Test Suite Updates: Remove corresponding test cases that checked the legacy initialization style.
Description
The
py-multihashrepository currently retains backwards-compatible APIs and constructor patterns originally introduced to facilitate migration from the legacypymultihashpackage. 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
Multihash(func, digest)fallback from theMultihashobject.Multihashto standardnamedtuplebehavior using strictly(code, name, length, digest).digest()andsum_stream()helper functions to explicitly compute and construct theMultihashobject using the canonical(code, name, length, digest)signature.