Skip to content

Diff of list and empty list is incorrect #575

@igo

Description

@igo

Describe the bug
Comparing of empty list produce incorrect results

Image

To Reproduce
from deepdiff.helper import COLORED_VIEW
from deepdiff import DeepDiff

t1 = [1,2,3]
t2 = [2]
print(DeepDiff(t1, t2, view=COLORED_VIEW))

t2 = []
print(DeepDiff(t1, t2, view=COLORED_VIEW))

Expected behavior
All removed item are shown (in this example 1, 2 and 3)

OS, DeepDiff version and Python version (please complete the following information):

  • OS: MacOS
  • Version 26
  • Python Version 3.12
  • DeepDiff Version 8.6.0

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions