Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing more than two items from a list #178

Open
the-bird-is-the-word opened this issue May 22, 2023 · 0 comments · May be fixed by #179
Open

Removing more than two items from a list #178

the-bird-is-the-word opened this issue May 22, 2023 · 0 comments · May be fixed by #179
Labels

Comments

@the-bird-is-the-word
Copy link

Package version (if known): 0.9.0

Describe the bug

There seems to be an error when more than two items are deleted from a list:

import dictdiffer

before = [{"idx": 1}, {"idx": 2}, {"idx": 3}, {"idx": 4}]
after = [{"idx": 1}]

dd = dictdiffer.diff(before, after)
print(dictdiffer.revert(dd, after))

prints

[{'idx': 1}, {'idx': 2}, {'idx': 4}, {'idx': 3}]

Steps to Reproduce

Try the code above.

Expected behavior

It should print

[{'idx': 1}, {'idx': 2}, {'idx': 3}, {'idx': 4}]

Additional context

It seems to occur only if more than 2 items are deleted - for 1 or 2 deleted items everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant