1616"""
1717
1818from functools import total_ordering
19- from typing import Any , Iterator , Iterable , Mapping , Optional , Text
19+ from typing import Any , Iterator , Iterable , Mapping , Optional , Text , Type
2020
2121from .exceptions import ObjectAlreadyExists
2222from .utils import intersection , OrderedDefaultDict
@@ -126,7 +126,13 @@ class DiffElement: # pylint: disable=too-many-instance-attributes
126126 """DiffElement object, designed to represent a single item/object that may or may not have any diffs."""
127127
128128 def __init__ (
129- self , obj_type : Text , name : Text , keys : Mapping , source_name : Text = "source" , dest_name : Text = "dest"
129+ self ,
130+ obj_type : Text ,
131+ name : Text ,
132+ keys : Mapping ,
133+ source_name : Text = "source" ,
134+ dest_name : Text = "dest" ,
135+ diff_class : Type [Diff ] = Diff ,
130136 ): # pylint: disable=too-many-arguments
131137 """Instantiate a DiffElement.
132138
@@ -152,7 +158,7 @@ def __init__(
152158 # Note: *_attrs == None if no target object exists; it'll be an empty dict if it exists but has no _attributes
153159 self .source_attrs : Optional [Mapping ] = None
154160 self .dest_attrs : Optional [Mapping ] = None
155- self .child_diff = Diff ()
161+ self .child_diff = diff_class ()
156162
157163 def __lt__ (self , other ):
158164 """Logical ordering of DiffElements.
0 commit comments