mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
[UserList]: Return type for slice is set to whatever self is (#5722)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import Any, Dict, Generic, List, NoReturn, Optional, Tuple, Type, TypeVar, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
@@ -69,7 +70,7 @@ class UserList(MutableSequence[_T]):
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> _T: ...
|
||||
@overload
|
||||
def __getitem__(self, i: slice) -> MutableSequence[_T]: ...
|
||||
def __getitem__(self: Self, i: slice) -> Self: ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, o: _T) -> None: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user