Skip to content

Refactor: Remove legacy pymultihash backward compatibility APIs #60

Description

@sumanjeet0012

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions