示例工程 11-protocols-generics-overloads

11-protocols-generics-overloads/05-typeis-narrowing/mypy-typeguard.txt

text · 0.4 KB

typeguard_case.py:10: error: No overload variant of "__add__" of "list" matches argument type "int"  [operator]
typeguard_case.py:10: note: Possible overload variants:
typeguard_case.py:10: note:     def __add__(self, list[str], /) -> list[str]
typeguard_case.py:10: note:     def [_S] __add__(self, list[_S], /) -> list[_S | str]
typeguard_case.py:10: note: Left operand is of type "int | list[str]"
Found 1 error in 1 file (checked 1 source file)