The overloads on list.__add__ lead to divergent behavior between mypy and pyright when doing something as simple as a list concatenation
# Overloading looks unnecessary, but is needed to work around complex mypy problems@overloaddef__add__(self, value: list[_T], /) ->list[_T]: ...
@overloaddef__add__(self, value: list[_S], /) ->list[_S|_T]: ...
Activity
tungol commented on Aug 21, 2025
We have some tests for dict.__or__ in https://github.com/python/typeshed/blob/main/stdlib/%40tests/test_cases/builtins/check_dict.py ; if your edge case isn't covered there already (and it doesn't seem to be) it'd be nice to flesh that out. Seeing the changes needed to the test suite following the removal of the overloads can be clarifying.
We don't have much in the way of tests characterizing list methods right now, so that's a good opportunity too.