Skip to main content

Compute the Myers diff of two lists

Project description

Inspired by https://gist.github.com/adamnew123456/37923cf53f51d6b9af32a539cdfa7cc4

API

myers.diff(a, b, context=None, format=None)

(myers.py, 25-60)

Return the Myers diff of two lists.

The result is a list of (action, line) pairs, where action is one of KEEP, INSERT, REMOVE, or OMIT (which happen to be the characters k, i, r, and o).

ARGUMENTS:
a, b:

The two files to compare

context:

How many lines of context to keep between blocks of changes? None, the default, means keep all unchanged lines. 0 means throw away all the unchanged lines.

format:

If a dictionary, it is used to format each diff entry. If true, the default dictionary above is used to format the diff entries. Otherwise they are returned as-is.

(automatically generated by doks on 2020-11-07T12:19:33.047064)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

myers-1.0.1.tar.gz (4.2 kB view hashes)

Uploaded source

Built Distribution

myers-1.0.1-py3-none-any.whl (6.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page