multiformats / multiformats/py-multihash

Refactor: Remove legacy pymultihash backward compatibility APIs

Open
#60 0 comments 0 reactions 0 assignees View on GitHub

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 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.