FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Return Union type for `List.__add__` by kaste · Pull Request #3183 · python/typeshed · GitHub

Repository navigation

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .pyi  (3) .txt  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 4 additions & 2 deletions stdlib/2/__builtin__.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,10 @@ class list(MutableSequence[_T], Generic[_T]):
def __getslice__(self, start: int, stop: int) -> List[_T]: ...
def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ...
def __delslice__(self, start: int, stop: int) -> None: ...
def __add__(self, x: List[_T]) -> List[_T]: ...
def __iadd__(self: _S, x: Iterable[_T]) -> _S: ...
def __add__(self, x: List[_S]) -> List[Union[_T, _S]]: ...
def __iadd__(self, x: Iterable[_S]) -> List[Union[_T, _S]]: ...
# Workaround https://github.com/python/mypy/issues/5971
def __radd__(self, x: List[_S]) -> List[Union[_T, _S]]: ...
def __mul__(self, n: int) -> List[_T]: ...
def __rmul__(self, n: int) -> List[_T]: ...
def __contains__(self, o: object) -> bool: ...
Expand Down
6 changes: 4 additions & 2 deletions stdlib/2/builtins.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,10 @@ class list(MutableSequence[_T], Generic[_T]):
def __getslice__(self, start: int, stop: int) -> List[_T]: ...
def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ...
def __delslice__(self, start: int, stop: int) -> None: ...
def __add__(self, x: List[_T]) -> List[_T]: ...
def __iadd__(self: _S, x: Iterable[_T]) -> _S: ...
def __add__(self, x: List[_S]) -> List[Union[_T, _S]]: ...
def __iadd__(self, x: Iterable[_S]) -> List[Union[_T, _S]]: ...
# Workaround https://github.com/python/mypy/issues/5971
def __radd__(self, x: List[_S]) -> List[Union[_T, _S]]: ...
def __mul__(self, n: int) -> List[_T]: ...
def __rmul__(self, n: int) -> List[_T]: ...
def __contains__(self, o: object) -> bool: ...
Expand Down
6 changes: 4 additions & 2 deletions stdlib/3/builtins.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,10 @@ class list(MutableSequence[_T], Generic[_T]):
@overload
def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ...
def __delitem__(self, i: Union[int, slice]) -> None: ...
def __add__(self, x: List[_T]) -> List[_T]: ...
def __iadd__(self: _S, x: Iterable[_T]) -> _S: ...
def __add__(self, x: List[_S]) -> List[Union[_T, _S]]: ...
def __iadd__(self, x: Iterable[_S]) -> List[Union[_T, _S]]: ...
# Workaround https://github.com/python/mypy/issues/5971
def __radd__(self, x: List[_S]) -> List[Union[_T, _S]]: ...
def __mul__(self, n: int) -> List[_T]: ...
def __rmul__(self, n: int) -> List[_T]: ...
def __imul__(self: _S, n: int) -> _S: ...
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_whitelists/py3_common.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ builtins.classmethod.__get__
builtins.complex.__complex__
builtins.ellipsis
builtins.function
builtins.list.__radd__
builtins.memoryview.__contains__
builtins.memoryview.__iter__
builtins.memoryview.cast
Expand Down

Back | FazBrowse Home | New Git URL