Skip to content

Refactor: Remove legacy pymultihash backward compatibility APIs - #61

Open
sumanjeet0012 wants to merge 2 commits into
multiformats:masterfrom
sumanjeet0012:remove-pymultihash-compat
Open

Refactor: Remove legacy pymultihash backward compatibility APIs#61
sumanjeet0012 wants to merge 2 commits into
multiformats:masterfrom
sumanjeet0012:remove-pymultihash-compat

Conversation

@sumanjeet0012

Copy link
Copy Markdown
Contributor

Description

This pull request removes 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, their complete removal streamlines the codebase and improves long-term maintainability.

Closes #60.

Proposed Changes

  • Remove Legacy Constructor: Removes the 2-argument constructor Multihash(func, digest) fallback from the Multihash object.
  • Enforce Canonical Initialization: Reverts Multihash to standard namedtuple behavior using strictly (code, name, length, digest).
  • Refactor Internal Helpers: Updates 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: Removes corresponding test cases that checked the legacy initialization style.

Justification

Removing these legacy wrappers ensures the library only supports the canonical usage patterns, reduces architectural complexity, and brings the implementation closer to native Python standards without carrying unnecessary historical baggage.

@sumanjeet0012
sumanjeet0012 force-pushed the remove-pymultihash-compat branch from 164cc5a to 2a67e11 Compare July 11, 2026 08:32
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.

Refactor: Remove legacy pymultihash backward compatibility APIs

1 participant