镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Diff of list and empty list is incorrect #575

Open

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.

Activity

  1. Nagato-Yuzuru commented on Jan 14, 2026

    @Nagato-Yuzuru

    Hi, it appears this is a ColorView display issue rather than a bug in the diff operation. Comparing against an empty dictionary produces the same result. I have submitted a pull request #578 to address this.

  2. salmantec commented on Mar 7, 2026

    @salmantec

    Hi, it appears this is a ColorView display issue rather than a bug in the diff operation. Comparing against an empty dictionary produces the same result. I have submitted a pull request #578 to address this.

    Nice catch though @Nagato-Yuzuru 👏 👏

  3. added a commit that references this issue on Mar 22, 2026
    5f77777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions