Skip to content

Commit 1a131a4

Browse files
authored
[UserList]: Return type for slice is set to whatever self is (#5722)
1 parent de19554 commit 1a131a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/collections/__init__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
from _typeshed import Self
23
from typing import Any, Dict, Generic, List, NoReturn, Optional, Tuple, Type, TypeVar, Union, overload
34

45
if sys.version_info >= (3, 10):
@@ -69,7 +70,7 @@ class UserList(MutableSequence[_T]):
6970
@overload
7071
def __getitem__(self, i: int) -> _T: ...
7172
@overload
72-
def __getitem__(self, i: slice) -> MutableSequence[_T]: ...
73+
def __getitem__(self: Self, i: slice) -> Self: ...
7374
@overload
7475
def __setitem__(self, i: int, o: _T) -> None: ...
7576
@overload

0 commit comments

Comments
 (0)