Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 843 Bytes

README.md

File metadata and controls

24 lines (20 loc) · 843 Bytes

Differ

Yet another object comparison tool.

This module provides a way to find differences between simple and complex (nested) objects.

This module do what others do (think of difflib / DeepDiff / ObjDiff), but the way I like, and with some magic.

Usage:

from differ import Differ
differ = Differ()
diff = differ.compare(object1, object2)
# diff is a Difference instance that can be traversed:

You can also play with inheritance from the Diffing class, that will override the bitwise xor operator ('^') so it will produces differencies:

from differ import Diffing
class MyClass(Diffing):
    pass

a = MyClass()
b = MyClass()
diff = a ^ b  # diff is a Difference instance