@@ -143,8 +143,7 @@ class Container(Protocol[_T_co]):
143143 @abstractmethod
144144 def __contains__ (self , x : object ) -> bool : ...
145145
146- @runtime
147- class Sequence (Iterable [_T_co ], Container [_T_co ], Sized , Reversible [_T_co ], Protocol [_T_co ]):
146+ class Sequence (Iterable [_T_co ], Container [_T_co ], Sized , Reversible [_T_co ], Generic [_T_co ]):
148147 @overload
149148 @abstractmethod
150149 def __getitem__ (self , i : int ) -> _T_co : ...
@@ -158,8 +157,7 @@ class Sequence(Iterable[_T_co], Container[_T_co], Sized, Reversible[_T_co], Prot
158157 def __iter__ (self ) -> Iterator [_T_co ]: ...
159158 def __reversed__ (self ) -> Iterator [_T_co ]: ...
160159
161- @runtime
162- class MutableSequence (Sequence [_T ], Protocol [_T ]):
160+ class MutableSequence (Sequence [_T ], Generic [_T ]):
163161 @abstractmethod
164162 def insert (self , index : int , object : _T ) -> None : ...
165163 @overload
@@ -233,8 +231,7 @@ class ContextManager(Protocol[_T_co]):
233231 exc_value : Optional [BaseException ],
234232 traceback : Optional [TracebackType ]) -> Optional [bool ]: ...
235233
236- @runtime # type: ignore
237- class Mapping (Iterable [_KT ], Container [_KT ], Sized , Protocol [_KT , _VT_co ]):
234+ class Mapping (Iterable [_KT ], Container [_KT ], Sized , Generic [_KT , _VT_co ]):
238235 # TODO: We wish the key type could also be covariant, but that doesn't work,
239236 # see discussion in https: //github.com/python/typing/pull/273.
240237 @abstractmethod
@@ -253,8 +250,7 @@ class Mapping(Iterable[_KT], Container[_KT], Sized, Protocol[_KT, _VT_co]):
253250 def iteritems (self ) -> Iterator [Tuple [_KT , _VT_co ]]: ...
254251 def __contains__ (self , o : object ) -> bool : ...
255252
256- @runtime
257- class MutableMapping (Mapping [_KT , _VT ], Protocol [_KT , _VT ]):
253+ class MutableMapping (Mapping [_KT , _VT ], Generic [_KT , _VT ]):
258254 @abstractmethod
259255 def __setitem__ (self , k : _KT , v : _VT ) -> None : ...
260256 @abstractmethod
0 commit comments