@@ -1240,7 +1240,7 @@ class Iterable(Generic[T_co], extra=collections_abc.Iterable):
1240
1240
pass
1241
1241
1242
1242
1243
- class Iterator (Iterable , extra = collections_abc .Iterator ):
1243
+ class Iterator (Iterable [ T_co ] , extra = collections_abc .Iterator ):
1244
1244
pass
1245
1245
1246
1246
@@ -1303,7 +1303,7 @@ class Container(Generic[T_co], extra=collections_abc.Container):
1303
1303
# Callable was defined earlier.
1304
1304
1305
1305
1306
- class AbstractSet (Sized , Iterable , Container , extra = collections_abc .Set ):
1306
+ class AbstractSet (Sized , Iterable [ T_co ] , Container [ T_co ] , extra = collections_abc .Set ):
1307
1307
pass
1308
1308
1309
1309
@@ -1320,7 +1320,7 @@ class MutableMapping(Mapping[KT, VT], extra=collections_abc.MutableMapping):
1320
1320
pass
1321
1321
1322
1322
1323
- class Sequence (Sized , Iterable , Container , extra = collections_abc .Sequence ):
1323
+ class Sequence (Sized , Iterable [ T_co ] , Container [ T_co ] , extra = collections_abc .Sequence ):
1324
1324
pass
1325
1325
1326
1326
@@ -1347,7 +1347,7 @@ def __instancecheck__(self, obj):
1347
1347
return True
1348
1348
1349
1349
1350
- class List (list , MutableSequence , metaclass = _ListMeta ):
1350
+ class List (list , MutableSequence [ T ] , metaclass = _ListMeta ):
1351
1351
1352
1352
def __new__ (self , * args , ** kwds ):
1353
1353
raise TypeError ("Type List cannot be instantiated; use list() instead" )
@@ -1365,7 +1365,7 @@ def __instancecheck__(self, obj):
1365
1365
return True
1366
1366
1367
1367
1368
- class Set (set , MutableSet , metaclass = _SetMeta ):
1368
+ class Set (set , MutableSet [ T ] , metaclass = _SetMeta ):
1369
1369
1370
1370
def __new__ (self , * args , ** kwds ):
1371
1371
raise TypeError ("Type Set cannot be instantiated; use set() instead" )
@@ -1390,28 +1390,28 @@ def __instancecheck__(self, obj):
1390
1390
return super ().__instancecheck__ (obj )
1391
1391
1392
1392
1393
- class FrozenSet (frozenset , AbstractSet , metaclass = _FrozenSetMeta ):
1393
+ class FrozenSet (frozenset , AbstractSet [ T_co ] , metaclass = _FrozenSetMeta ):
1394
1394
1395
1395
def __new__ (self , * args , ** kwds ):
1396
1396
raise TypeError ("Type FrozenSet cannot be instantiated; "
1397
1397
"use frozenset() instead" )
1398
1398
1399
1399
1400
- class MappingView (Sized , Iterable , extra = collections_abc .MappingView ):
1400
+ class MappingView (Sized , Iterable [ T_co ] , extra = collections_abc .MappingView ):
1401
1401
pass
1402
1402
1403
1403
1404
- class KeysView (MappingView , Set [ KT ], extra = collections_abc .KeysView ):
1404
+ class KeysView (MappingView [ KT_co ], AbstractSet [ KT_co ], extra = collections_abc .KeysView ):
1405
1405
pass
1406
1406
1407
1407
1408
- # TODO: Enable Set[Tuple[KT, VT ]] instead of Generic[KT, VT ].
1408
+ # TODO: Enable Set[Tuple[KT_co, VT_co ]] instead of Generic[KT_co, VT_co ].
1409
1409
class ItemsView (MappingView , Generic [KT_co , VT_co ],
1410
1410
extra = collections_abc .ItemsView ):
1411
1411
pass
1412
1412
1413
1413
1414
- class ValuesView (MappingView , extra = collections_abc .ValuesView ):
1414
+ class ValuesView (MappingView [ VT_co ] , extra = collections_abc .ValuesView ):
1415
1415
pass
1416
1416
1417
1417
@@ -1428,7 +1428,7 @@ def __instancecheck__(self, obj):
1428
1428
return True
1429
1429
1430
1430
1431
- class Dict (dict , MutableMapping , metaclass = _DictMeta ):
1431
+ class Dict (dict , MutableMapping [ KT , VT ] , metaclass = _DictMeta ):
1432
1432
1433
1433
def __new__ (self , * args , ** kwds ):
1434
1434
raise TypeError ("Type Dict cannot be instantiated; use dict() instead" )
0 commit comments