python / python/cpython

Composability of `difflib`

Open
#145,209 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

Proposal:

I closed https://github.com/python/cpython/issues/144132 in favour to more gradual divide and conquer approach.

And this is the first part, which I think is the most valuable one.
It enables user to implement his own Matcher and Differ types to do all the nice things that difflib enables.

Given the current state of affairs, I don't think there were many ways to do it.
And in terms of nature of arguments provided to different functions, I only saw one.

Very much open to any suggestions / concerns.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/algorithmic-complexity-of-difflib/105844/98

Linked PRs
  • gh-145210

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 reviewing linked PR gh-145210 and the Discourse discussion referenced in the issue, then inspect Python's difflib implementation and public API. The work is complete when the proposed composability approach has a settled design and the linked contribution or resulting changes address the proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.