From 1a131a489efc86e5de9e01fcb2083d93226b4f57 Mon Sep 17 00:00:00 2001 From: Fabian Raab Date: Fri, 2 Jul 2021 21:20:17 +0200 Subject: [PATCH] [UserList]: Return type for slice is set to whatever self is (#5722) --- stdlib/collections/__init__.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 635d32ebd..a625c2b38 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -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