1- from collections .abc import Collection , Iterable , Iterator , Mapping , MutableSet
2- from typing import Any , Generic , Protocol , Tuple , TypeVar , overload # noqa: Y022
1+ from collections .abc import Collection , Iterable , Iterator , Mapping , MutableMapping , MutableSet
2+ from typing import Any , Generic , NoReturn , Protocol , Tuple , TypeVar , overload # noqa: Y022
33
4- from _typeshed import Self
5- from typing_extensions import TypeAlias
4+ from _typeshed import Incomplete
5+ from typing_extensions import Self , TypeAlias
66
77_K = TypeVar ("_K" )
88_V = TypeVar ("_V" )
@@ -39,13 +39,14 @@ class _IndexableCollection(Protocol[_I], Collection[_I]):
3939 @overload
4040 def __getitem__ (self , index : int ) -> _I : ...
4141 @overload
42- def __getitem__ (self : Self , index : slice ) -> Self : ...
42+ def __getitem__ (self , index : slice ) -> Self : ...
4343
4444class OrderedSet (MutableSet [_K ]):
4545 dict : dict [_K , None ]
4646 def __init__ (self , iterable : Iterable [_K ] | None = ...) -> None : ...
4747 def __contains__ (self , item : object ) -> bool : ...
4848 def __iter__ (self ) -> Iterator [_K ]: ...
49+ def __reversed__ (self ) -> Iterator [_K ]: ...
4950 def __bool__ (self ) -> bool : ...
5051 def __len__ (self ) -> int : ...
5152 def add (self , item : _K ) -> None : ...
@@ -74,7 +75,7 @@ class MultiValueDict(dict[_K, _V]):
7475 def items (self ) -> Iterator [tuple [_K , _V | list [object ]]]: ... # type: ignore
7576 def lists (self ) -> Iterable [tuple [_K , list [_V ]]]: ...
7677 def dict (self ) -> dict [_K , _V | list [object ]]: ...
77- def copy (self : Self ) -> Self : ...
78+ def copy (self ) -> Self : ...
7879 def __getitem__ (self , key : _K ) -> _V | list [object ]: ... # type: ignore
7980 def __setitem__ (self , key : _K , value : _V ) -> None : ...
8081 # These overrides are needed to convince mypy that this isn't an abstract class
@@ -83,11 +84,13 @@ class MultiValueDict(dict[_K, _V]):
8384 def __iter__ (self ) -> Iterator [_K ]: ...
8485 # Fake to make `values` work properly
8586 def values (self ) -> Iterator [_V | list [object ]]: ... # type: ignore[override]
87+ def __copy__ (self ) -> Self : ...
88+ def __deepcopy__ (self , memo : MutableMapping [int , Incomplete ]) -> Self : ...
8689
8790class ImmutableList (tuple [_V , ...]):
8891 warning : str
89- def __new__ (cls : type [ Self ] , * args : Any , warning : str = ..., ** kwargs : Any ) -> Self : ...
90- def complain (self , * args : Any , ** kwargs : Any ) -> None : ...
92+ def __new__ (cls , * args : Any , warning : str = ..., ** kwargs : Any ) -> Self : ...
93+ def complain (self , * args : Any , ** kwargs : Any ) -> NoReturn : ...
9194
9295class _ItemCallable (Protocol [_V ]):
9396 """Don't mess with arguments when assigning in class body in stub"""
0 commit comments