Bug report
Issue
sorted_list_difference claims in its docstring that "Duplicate elements in either input list are ignored," but when one list is exhausted before the other, the remaining elements (including duplicates) are appended without deduplication.
Reproducer
from unittest.util import sorted_list_difference
print(sorted_list_difference([], [0, 0]))
# Output: ([], [0, 0]) — expected ([], [0])
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Issue
sorted_list_differenceclaims in its docstring that "Duplicate elements in either input list are ignored," but when one list is exhausted before the other, the remaining elements (including duplicates) are appended without deduplication.Reproducer
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
sorted_list_differencetail deduplication #145547