Metadata-Version: 2.1
Name: diff
Version: 2023.12.3
Summary: You diff objects, you find out why they ain't the same.
Project-URL: Documentation, https://diff.readthedocs.io/
Project-URL: Homepage, https://github.com/Julian/diff
Project-URL: Issues, https://github.com/Julian/diff/issues/
Project-URL: Funding, https://github.com/sponsors/Julian
Project-URL: Source, https://github.com/Julian/diff
Author: Julian Berman
Author-email: Julian+diff@GrayVines.com
License: MIT
License-File: COPYING
Keywords: diff,difference,protocol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Requires-Dist: attrs>=23.1.0
Description-Content-Type: text/x-rst

====
diff
====

|PyPI| |Pythons| |CI| |pre-commit|

.. |PyPI| image:: https://img.shields.io/pypi/v/diff.svg
  :alt: PyPI version
  :target: https://pypi.org/project/diff/

.. |Pythons| image:: https://img.shields.io/pypi/pyversions/diff.svg
  :alt: Supported Python versions
  :target: https://pypi.org/project/diff/

.. |CI| image:: https://github.com/Julian/diff/workflows/CI/badge.svg
  :alt: Build status
  :target: https://github.com/Julian/diff/actions?query=workflow%3ACI

.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/Julian/diff/main.svg
  :alt: pre-commit.ci status
  :target: https://results.pre-commit.ci/latest/github/Julian/diff/main


``diff`` defines a difference protocol. Watch:

.. code-block:: python

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