Skip to main content

You diff objects, you find out why they ain't the same.

Project description

PyPI version Supported Python versions Build status pre-commit.ci status

diff defines a difference protocol. Watch:

>>> class LonelyObject:
...     def __diff__(self, other):
...         return f"{self} is not like {other}"
...
...     def __repr__(self):
...         return "<LonelyObject>"

>>> from diff import diff
>>> diff(LonelyObject(), 12).explain()
'<LonelyObject> is not like 12'

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

diff-2023.12.4.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

diff-2023.12.4-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page