@@ -524,7 +524,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
524
524
is equivalent to ``Tuple[Any, ...] ``, and in turn to :class: `tuple `.
525
525
526
526
.. deprecated :: 3.9
527
- :class: `builtins.tuple <tuple> ` now supports ``[] ``. See :pep: `585 `.
527
+ :class: `builtins.tuple <tuple> ` now supports ``[] ``. See :pep: `585 ` and
528
+ :ref: `types-genericalias `.
528
529
529
530
.. data :: Union
530
531
@@ -602,7 +603,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
602
603
:class: `collections.abc.Callable `.
603
604
604
605
.. deprecated :: 3.9
605
- :class: `collections.abc.Callable ` now supports ``[] ``. See :pep: `585 `.
606
+ :class: `collections.abc.Callable ` now supports ``[] ``. See :pep: `585 ` and
607
+ :ref: `types-genericalias `.
606
608
607
609
.. class :: Type(Generic[CT_co])
608
610
@@ -647,7 +649,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
647
649
.. versionadded :: 3.5.2
648
650
649
651
.. deprecated :: 3.9
650
- :class: `builtins.type <type> ` now supports ``[] ``. See :pep: `585 `.
652
+ :class: `builtins.type <type> ` now supports ``[] ``. See :pep: `585 ` and
653
+ :ref: `types-genericalias `.
651
654
652
655
.. data :: Literal
653
656
@@ -1079,7 +1082,8 @@ Corresponding to built-in types
1079
1082
...
1080
1083
1081
1084
.. deprecated :: 3.9
1082
- :class: `builtins.dict <dict> ` now supports ``[] ``. See :pep: `585 `.
1085
+ :class: `builtins.dict <dict> ` now supports ``[] ``. See :pep: `585 ` and
1086
+ :ref: `types-genericalias `.
1083
1087
1084
1088
.. class :: List(list, MutableSequence[T])
1085
1089
@@ -1099,7 +1103,8 @@ Corresponding to built-in types
1099
1103
return [item for item in vector if item > 0]
1100
1104
1101
1105
.. deprecated :: 3.9
1102
- :class: `builtins.list <list> ` now supports ``[] ``. See :pep: `585 `.
1106
+ :class: `builtins.list <list> ` now supports ``[] ``. See :pep: `585 ` and
1107
+ :ref: `types-genericalias `.
1103
1108
1104
1109
.. class :: Set(set, MutableSet[T])
1105
1110
@@ -1108,14 +1113,16 @@ Corresponding to built-in types
1108
1113
to use an abstract collection type such as :class: `AbstractSet `.
1109
1114
1110
1115
.. deprecated :: 3.9
1111
- :class: `builtins.set <set> ` now supports ``[] ``. See :pep: `585 `.
1116
+ :class: `builtins.set <set> ` now supports ``[] ``. See :pep: `585 ` and
1117
+ :ref: `types-genericalias `.
1112
1118
1113
1119
.. class :: FrozenSet(frozenset, AbstractSet[T_co])
1114
1120
1115
1121
A generic version of :class: `builtins.frozenset <frozenset> `.
1116
1122
1117
1123
.. deprecated :: 3.9
1118
- :class: `builtins.frozenset <frozenset> ` now supports ``[] ``. See :pep: `585 `.
1124
+ :class: `builtins.frozenset <frozenset> ` now supports ``[] ``. See
1125
+ :pep: `585 ` and :ref: `types-genericalias `.
1119
1126
1120
1127
.. note :: :data:`Tuple` is a special form.
1121
1128
@@ -1129,7 +1136,8 @@ Corresponding to types in :mod:`collections`
1129
1136
.. versionadded :: 3.5.2
1130
1137
1131
1138
.. deprecated :: 3.9
1132
- :class: `collections.defaultdict ` now supports ``[] ``. See :pep: `585 `.
1139
+ :class: `collections.defaultdict ` now supports ``[] ``. See :pep: `585 ` and
1140
+ :ref: `types-genericalias `.
1133
1141
1134
1142
.. class :: OrderedDict(collections.OrderedDict, MutableMapping[KT, VT])
1135
1143
@@ -1138,7 +1146,8 @@ Corresponding to types in :mod:`collections`
1138
1146
.. versionadded :: 3.7.2
1139
1147
1140
1148
.. deprecated :: 3.9
1141
- :class: `collections.OrderedDict ` now supports ``[] ``. See :pep: `585 `.
1149
+ :class: `collections.OrderedDict ` now supports ``[] ``. See :pep: `585 ` and
1150
+ :ref: `types-genericalias `.
1142
1151
1143
1152
.. class :: ChainMap(collections.ChainMap, MutableMapping[KT, VT])
1144
1153
@@ -1148,7 +1157,8 @@ Corresponding to types in :mod:`collections`
1148
1157
.. versionadded :: 3.6.1
1149
1158
1150
1159
.. deprecated :: 3.9
1151
- :class: `collections.ChainMap ` now supports ``[] ``. See :pep: `585 `.
1160
+ :class: `collections.ChainMap ` now supports ``[] ``. See :pep: `585 ` and
1161
+ :ref: `types-genericalias `.
1152
1162
1153
1163
.. class :: Counter(collections.Counter, Dict[T, int])
1154
1164
@@ -1158,7 +1168,8 @@ Corresponding to types in :mod:`collections`
1158
1168
.. versionadded :: 3.6.1
1159
1169
1160
1170
.. deprecated :: 3.9
1161
- :class: `collections.Counter ` now supports ``[] ``. See :pep: `585 `.
1171
+ :class: `collections.Counter ` now supports ``[] ``. See :pep: `585 ` and
1172
+ :ref: `types-genericalias `.
1162
1173
1163
1174
.. class :: Deque(deque, MutableSequence[T])
1164
1175
@@ -1168,7 +1179,8 @@ Corresponding to types in :mod:`collections`
1168
1179
.. versionadded :: 3.6.1
1169
1180
1170
1181
.. deprecated :: 3.9
1171
- :class: `collections.deque ` now supports ``[] ``. See :pep: `585 `.
1182
+ :class: `collections.deque ` now supports ``[] ``. See :pep: `585 ` and
1183
+ :ref: `types-genericalias `.
1172
1184
1173
1185
Other concrete types
1174
1186
""""""""""""""""""""
@@ -1193,7 +1205,8 @@ Other concrete types
1193
1205
``Match[bytes] ``. These types are also in the ``typing.re `` namespace.
1194
1206
1195
1207
.. deprecated :: 3.9
1196
- Classes ``Pattern `` and ``Match `` from :mod: `re ` now support ``[] ``. See :pep: `585 `.
1208
+ Classes ``Pattern `` and ``Match `` from :mod: `re ` now support ``[] ``.
1209
+ See :pep: `585 ` and :ref: `types-genericalias `.
1197
1210
1198
1211
.. class :: Text
1199
1212
@@ -1220,7 +1233,8 @@ Corresponding to collections in :mod:`collections.abc`
1220
1233
A generic version of :class: `collections.abc.Set `.
1221
1234
1222
1235
.. deprecated :: 3.9
1223
- :class: `collections.abc.Set ` now supports ``[] ``. See :pep: `585 `.
1236
+ :class: `collections.abc.Set ` now supports ``[] ``. See :pep: `585 ` and
1237
+ :ref: `types-genericalias `.
1224
1238
1225
1239
.. class :: ByteString(Sequence[int])
1226
1240
@@ -1233,7 +1247,8 @@ Corresponding to collections in :mod:`collections.abc`
1233
1247
annotate arguments of any of the types mentioned above.
1234
1248
1235
1249
.. deprecated :: 3.9
1236
- :class: `collections.abc.ByteString ` now supports ``[] ``. See :pep: `585 `.
1250
+ :class: `collections.abc.ByteString ` now supports ``[] ``. See :pep: `585 `
1251
+ and :ref: `types-genericalias `.
1237
1252
1238
1253
.. class :: Collection(Sized, Iterable[T_co], Container[T_co])
1239
1254
@@ -1242,28 +1257,32 @@ Corresponding to collections in :mod:`collections.abc`
1242
1257
.. versionadded :: 3.6.0
1243
1258
1244
1259
.. deprecated :: 3.9
1245
- :class: `collections.abc.Collection ` now supports ``[] ``. See :pep: `585 `.
1260
+ :class: `collections.abc.Collection ` now supports ``[] ``. See :pep: `585 `
1261
+ and :ref: `types-genericalias `.
1246
1262
1247
1263
.. class :: Container(Generic[T_co])
1248
1264
1249
1265
A generic version of :class: `collections.abc.Container `.
1250
1266
1251
1267
.. deprecated :: 3.9
1252
- :class: `collections.abc.Container ` now supports ``[] ``. See :pep: `585 `.
1268
+ :class: `collections.abc.Container ` now supports ``[] ``. See :pep: `585 `
1269
+ and :ref: `types-genericalias `.
1253
1270
1254
1271
.. class :: ItemsView(MappingView, Generic[KT_co, VT_co])
1255
1272
1256
1273
A generic version of :class: `collections.abc.ItemsView `.
1257
1274
1258
1275
.. deprecated :: 3.9
1259
- :class: `collections.abc.ItemsView ` now supports ``[] ``. See :pep: `585 `.
1276
+ :class: `collections.abc.ItemsView ` now supports ``[] ``. See :pep: `585 `
1277
+ and :ref: `types-genericalias `.
1260
1278
1261
1279
.. class :: KeysView(MappingView[KT_co], AbstractSet[KT_co])
1262
1280
1263
1281
A generic version of :class: `collections.abc.KeysView `.
1264
1282
1265
1283
.. deprecated :: 3.9
1266
- :class: `collections.abc.KeysView ` now supports ``[] ``. See :pep: `585 `.
1284
+ :class: `collections.abc.KeysView ` now supports ``[] ``. See :pep: `585 `
1285
+ and :ref: `types-genericalias `.
1267
1286
1268
1287
.. class :: Mapping(Sized, Collection[KT], Generic[VT_co])
1269
1288
@@ -1274,49 +1293,56 @@ Corresponding to collections in :mod:`collections.abc`
1274
1293
return word_list[word]
1275
1294
1276
1295
.. deprecated :: 3.9
1277
- :class: `collections.abc.Mapping ` now supports ``[] ``. See :pep: `585 `.
1296
+ :class: `collections.abc.Mapping ` now supports ``[] ``. See :pep: `585 `
1297
+ and :ref: `types-genericalias `.
1278
1298
1279
1299
.. class :: MappingView(Sized, Iterable[T_co])
1280
1300
1281
1301
A generic version of :class: `collections.abc.MappingView `.
1282
1302
1283
1303
.. deprecated :: 3.9
1284
- :class: `collections.abc.MappingView ` now supports ``[] ``. See :pep: `585 `.
1304
+ :class: `collections.abc.MappingView ` now supports ``[] ``. See :pep: `585 `
1305
+ and :ref: `types-genericalias `.
1285
1306
1286
1307
.. class :: MutableMapping(Mapping[KT, VT])
1287
1308
1288
1309
A generic version of :class: `collections.abc.MutableMapping `.
1289
1310
1290
1311
.. deprecated :: 3.9
1291
- :class: `collections.abc.MutableMapping ` now supports ``[] ``. See :pep: `585 `.
1312
+ :class: `collections.abc.MutableMapping ` now supports ``[] ``. See
1313
+ :pep: `585 ` and :ref: `types-genericalias `.
1292
1314
1293
1315
.. class :: MutableSequence(Sequence[T])
1294
1316
1295
1317
A generic version of :class: `collections.abc.MutableSequence `.
1296
1318
1297
1319
.. deprecated :: 3.9
1298
- :class: `collections.abc.MutableSequence ` now supports ``[] ``. See :pep: `585 `.
1320
+ :class: `collections.abc.MutableSequence ` now supports ``[] ``. See
1321
+ :pep: `585 ` and :ref: `types-genericalias `.
1299
1322
1300
1323
.. class :: MutableSet(AbstractSet[T])
1301
1324
1302
1325
A generic version of :class: `collections.abc.MutableSet `.
1303
1326
1304
1327
.. deprecated :: 3.9
1305
- :class: `collections.abc.MutableSet ` now supports ``[] ``. See :pep: `585 `.
1328
+ :class: `collections.abc.MutableSet ` now supports ``[] ``. See :pep: `585 `
1329
+ and :ref: `types-genericalias `.
1306
1330
1307
1331
.. class :: Sequence(Reversible[T_co], Collection[T_co])
1308
1332
1309
1333
A generic version of :class: `collections.abc.Sequence `.
1310
1334
1311
1335
.. deprecated :: 3.9
1312
- :class: `collections.abc.Sequence ` now supports ``[] ``. See :pep: `585 `.
1336
+ :class: `collections.abc.Sequence ` now supports ``[] ``. See :pep: `585 `
1337
+ and :ref: `types-genericalias `.
1313
1338
1314
1339
.. class :: ValuesView(MappingView[VT_co])
1315
1340
1316
1341
A generic version of :class: `collections.abc.ValuesView `.
1317
1342
1318
1343
.. deprecated :: 3.9
1319
- :class: `collections.abc.ValuesView ` now supports ``[] ``. See :pep: `585 `.
1344
+ :class: `collections.abc.ValuesView ` now supports ``[] ``. See :pep: `585 `
1345
+ and :ref: `types-genericalias `.
1320
1346
1321
1347
Corresponding to other types in :mod: `collections.abc `
1322
1348
""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -1326,14 +1352,16 @@ Corresponding to other types in :mod:`collections.abc`
1326
1352
A generic version of :class: `collections.abc.Iterable `.
1327
1353
1328
1354
.. deprecated :: 3.9
1329
- :class: `collections.abc.Iterable ` now supports ``[] ``. See :pep: `585 `.
1355
+ :class: `collections.abc.Iterable ` now supports ``[] ``. See :pep: `585 `
1356
+ and :ref: `types-genericalias `.
1330
1357
1331
1358
.. class :: Iterator(Iterable[T_co])
1332
1359
1333
1360
A generic version of :class: `collections.abc.Iterator `.
1334
1361
1335
1362
.. deprecated :: 3.9
1336
- :class: `collections.abc.Iterator ` now supports ``[] ``. See :pep: `585 `.
1363
+ :class: `collections.abc.Iterator ` now supports ``[] ``. See :pep: `585 `
1364
+ and :ref: `types-genericalias `.
1337
1365
1338
1366
.. class :: Generator(Iterator[T_co], Generic[T_co, T_contra, V_co])
1339
1367
@@ -1367,7 +1395,8 @@ Corresponding to other types in :mod:`collections.abc`
1367
1395
start += 1
1368
1396
1369
1397
.. deprecated :: 3.9
1370
- :class: `collections.abc.Generator ` now supports ``[] ``. See :pep: `585 `.
1398
+ :class: `collections.abc.Generator ` now supports ``[] ``. See :pep: `585 `
1399
+ and :ref: `types-genericalias `.
1371
1400
1372
1401
.. class :: Hashable
1373
1402
@@ -1378,7 +1407,8 @@ Corresponding to other types in :mod:`collections.abc`
1378
1407
A generic version of :class: `collections.abc.Reversible `.
1379
1408
1380
1409
.. deprecated :: 3.9
1381
- :class: `collections.abc.Reversible ` now supports ``[] ``. See :pep: `585 `.
1410
+ :class: `collections.abc.Reversible ` now supports ``[] ``. See :pep: `585 `
1411
+ and :ref: `types-genericalias `.
1382
1412
1383
1413
.. class :: Sized
1384
1414
@@ -1403,7 +1433,8 @@ Asynchronous programming
1403
1433
.. versionadded :: 3.5.3
1404
1434
1405
1435
.. deprecated :: 3.9
1406
- :class: `collections.abc.Coroutine ` now supports ``[] ``. See :pep: `585 `.
1436
+ :class: `collections.abc.Coroutine ` now supports ``[] ``. See :pep: `585 `
1437
+ and :ref: `types-genericalias `.
1407
1438
1408
1439
.. class :: AsyncGenerator(AsyncIterator[T_co], Generic[T_co, T_contra])
1409
1440
@@ -1439,7 +1470,8 @@ Asynchronous programming
1439
1470
.. versionadded :: 3.6.1
1440
1471
1441
1472
.. deprecated :: 3.9
1442
- :class: `collections.abc.AsyncGenerator ` now supports ``[] ``. See :pep: `585 `.
1473
+ :class: `collections.abc.AsyncGenerator ` now supports ``[] ``. See
1474
+ :pep: `585 ` and :ref: `types-genericalias `.
1443
1475
1444
1476
.. class :: AsyncIterable(Generic[T_co])
1445
1477
@@ -1448,7 +1480,8 @@ Asynchronous programming
1448
1480
.. versionadded :: 3.5.2
1449
1481
1450
1482
.. deprecated :: 3.9
1451
- :class: `collections.abc.AsyncIterable ` now supports ``[] ``. See :pep: `585 `.
1483
+ :class: `collections.abc.AsyncIterable ` now supports ``[] ``. See :pep: `585 `
1484
+ and :ref: `types-genericalias `.
1452
1485
1453
1486
.. class :: AsyncIterator(AsyncIterable[T_co])
1454
1487
@@ -1457,7 +1490,8 @@ Asynchronous programming
1457
1490
.. versionadded :: 3.5.2
1458
1491
1459
1492
.. deprecated :: 3.9
1460
- :class: `collections.abc.AsyncIterator ` now supports ``[] ``. See :pep: `585 `.
1493
+ :class: `collections.abc.AsyncIterator ` now supports ``[] ``. See :pep: `585 `
1494
+ and :ref: `types-genericalias `.
1461
1495
1462
1496
.. class :: Awaitable(Generic[T_co])
1463
1497
@@ -1466,7 +1500,8 @@ Asynchronous programming
1466
1500
.. versionadded :: 3.5.2
1467
1501
1468
1502
.. deprecated :: 3.9
1469
- :class: `collections.abc.Awaitable ` now supports ``[] ``. See :pep: `585 `.
1503
+ :class: `collections.abc.Awaitable ` now supports ``[] ``. See :pep: `585 `
1504
+ and :ref: `types-genericalias `.
1470
1505
1471
1506
1472
1507
Context manager types
@@ -1480,7 +1515,8 @@ Context manager types
1480
1515
.. versionadded :: 3.6.0
1481
1516
1482
1517
.. deprecated :: 3.9
1483
- :class: `contextlib.AbstractContextManager ` now supports ``[] ``. See :pep: `585 `.
1518
+ :class: `contextlib.AbstractContextManager ` now supports ``[] ``. See
1519
+ :pep: `585 ` and :ref: `types-genericalias `.
1484
1520
1485
1521
.. class :: AsyncContextManager(Generic[T_co])
1486
1522
@@ -1490,7 +1526,8 @@ Context manager types
1490
1526
.. versionadded :: 3.6.2
1491
1527
1492
1528
.. deprecated :: 3.9
1493
- :class: `contextlib.AbstractAsyncContextManager ` now supports ``[] ``. See :pep: `585 `.
1529
+ :class: `contextlib.AbstractAsyncContextManager ` now supports ``[] ``. See
1530
+ :pep: `585 ` and :ref: `types-genericalias `.
1494
1531
1495
1532
Protocols
1496
1533
---------
0 commit comments