You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I request adding an in-place patch/revert capability, i.e. option for performing these operations without copying the target structure.
This would be a useful performance optimization in some large-volume use cases. I also have a functional need of patching in place while recording all changes made to the structure.
This could be implemented as an additional, optional parameter to patch and revert:
Patch:
def patch(diff_result, destination, in_place=False):
"""Docstring"""
if not in_place:
destination = copy.deepcopy(destination)
a = {
'a' : 1
}
b = {
'a' : 2
}
changes = list(diff(a, b))
c = patch(changes, a)
assert a != c
d = revert(changes, c, in_place=True)
assert a == d
assert c == d
e = patch(changes, a, in_place=True)
assert a == e
The text was updated successfully, but these errors were encountered:
I request adding an in-place patch/revert capability, i.e. option for performing these operations without copying the target structure.
This would be a useful performance optimization in some large-volume use cases. I also have a functional need of patching in place while recording all changes made to the structure.
This could be implemented as an additional, optional parameter to patch and revert:
Patch:
Revert:
And tested with e.g.
The text was updated successfully, but these errors were encountered: