@@ -509,7 +509,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
509
509
is equivalent to ``Tuple[Any, ...] ``, and in turn to :class: `tuple `.
510
510
511
511
.. deprecated :: 3.9
512
- :class: `builtins.tuple <tuple> ` now supports ``[] ``. See :pep: `585 `.
512
+ :class: `builtins.tuple <tuple> ` now supports ``[] ``. See :pep: `585 ` and
513
+ :ref: `types-genericalias `.
513
514
514
515
.. data :: Union
515
516
@@ -583,7 +584,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
583
584
:class: `collections.abc.Callable `.
584
585
585
586
.. deprecated :: 3.9
586
- :class: `collections.abc.Callable ` now supports ``[] ``. See :pep: `585 `.
587
+ :class: `collections.abc.Callable ` now supports ``[] ``. See :pep: `585 ` and
588
+ :ref: `types-genericalias `.
587
589
588
590
.. class :: Type(Generic[CT_co])
589
591
@@ -628,7 +630,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
628
630
.. versionadded :: 3.5.2
629
631
630
632
.. deprecated :: 3.9
631
- :class: `builtins.type <type> ` now supports ``[] ``. See :pep: `585 `.
633
+ :class: `builtins.type <type> ` now supports ``[] ``. See :pep: `585 ` and
634
+ :ref: `types-genericalias `.
632
635
633
636
.. data :: Literal
634
637
@@ -1060,7 +1063,8 @@ Corresponding to built-in types
1060
1063
...
1061
1064
1062
1065
.. deprecated :: 3.9
1063
- :class: `builtins.dict <dict> ` now supports ``[] ``. See :pep: `585 `.
1066
+ :class: `builtins.dict <dict> ` now supports ``[] ``. See :pep: `585 ` and
1067
+ :ref: `types-genericalias `.
1064
1068
1065
1069
.. class :: List(list, MutableSequence[T])
1066
1070
@@ -1080,7 +1084,8 @@ Corresponding to built-in types
1080
1084
return [item for item in vector if item > 0]
1081
1085
1082
1086
.. deprecated :: 3.9
1083
- :class: `builtins.list <list> ` now supports ``[] ``. See :pep: `585 `.
1087
+ :class: `builtins.list <list> ` now supports ``[] ``. See :pep: `585 ` and
1088
+ :ref: `types-genericalias `.
1084
1089
1085
1090
.. class :: Set(set, MutableSet[T])
1086
1091
@@ -1089,14 +1094,16 @@ Corresponding to built-in types
1089
1094
to use an abstract collection type such as :class: `AbstractSet `.
1090
1095
1091
1096
.. deprecated :: 3.9
1092
- :class: `builtins.set <set> ` now supports ``[] ``. See :pep: `585 `.
1097
+ :class: `builtins.set <set> ` now supports ``[] ``. See :pep: `585 ` and
1098
+ :ref: `types-genericalias `.
1093
1099
1094
1100
.. class :: FrozenSet(frozenset, AbstractSet[T_co])
1095
1101
1096
1102
A generic version of :class: `builtins.frozenset <frozenset> `.
1097
1103
1098
1104
.. deprecated :: 3.9
1099
- :class: `builtins.frozenset <frozenset> ` now supports ``[] ``. See :pep: `585 `.
1105
+ :class: `builtins.frozenset <frozenset> ` now supports ``[] ``. See
1106
+ :pep: `585 ` and :ref: `types-genericalias `.
1100
1107
1101
1108
.. note :: :data:`Tuple` is a special form.
1102
1109
@@ -1110,7 +1117,8 @@ Corresponding to types in :mod:`collections`
1110
1117
.. versionadded :: 3.5.2
1111
1118
1112
1119
.. deprecated :: 3.9
1113
- :class: `collections.defaultdict ` now supports ``[] ``. See :pep: `585 `.
1120
+ :class: `collections.defaultdict ` now supports ``[] ``. See :pep: `585 ` and
1121
+ :ref: `types-genericalias `.
1114
1122
1115
1123
.. class :: OrderedDict(collections.OrderedDict, MutableMapping[KT, VT])
1116
1124
@@ -1119,7 +1127,8 @@ Corresponding to types in :mod:`collections`
1119
1127
.. versionadded :: 3.7.2
1120
1128
1121
1129
.. deprecated :: 3.9
1122
- :class: `collections.OrderedDict ` now supports ``[] ``. See :pep: `585 `.
1130
+ :class: `collections.OrderedDict ` now supports ``[] ``. See :pep: `585 ` and
1131
+ :ref: `types-genericalias `.
1123
1132
1124
1133
.. class :: ChainMap(collections.ChainMap, MutableMapping[KT, VT])
1125
1134
@@ -1129,7 +1138,8 @@ Corresponding to types in :mod:`collections`
1129
1138
.. versionadded :: 3.6.1
1130
1139
1131
1140
.. deprecated :: 3.9
1132
- :class: `collections.ChainMap ` now supports ``[] ``. See :pep: `585 `.
1141
+ :class: `collections.ChainMap ` now supports ``[] ``. See :pep: `585 ` and
1142
+ :ref: `types-genericalias `.
1133
1143
1134
1144
.. class :: Counter(collections.Counter, Dict[T, int])
1135
1145
@@ -1139,7 +1149,8 @@ Corresponding to types in :mod:`collections`
1139
1149
.. versionadded :: 3.6.1
1140
1150
1141
1151
.. deprecated :: 3.9
1142
- :class: `collections.Counter ` now supports ``[] ``. See :pep: `585 `.
1152
+ :class: `collections.Counter ` now supports ``[] ``. See :pep: `585 ` and
1153
+ :ref: `types-genericalias `.
1143
1154
1144
1155
.. class :: Deque(deque, MutableSequence[T])
1145
1156
@@ -1149,7 +1160,8 @@ Corresponding to types in :mod:`collections`
1149
1160
.. versionadded :: 3.6.1
1150
1161
1151
1162
.. deprecated :: 3.9
1152
- :class: `collections.deque ` now supports ``[] ``. See :pep: `585 `.
1163
+ :class: `collections.deque ` now supports ``[] ``. See :pep: `585 ` and
1164
+ :ref: `types-genericalias `.
1153
1165
1154
1166
Other concrete types
1155
1167
""""""""""""""""""""
@@ -1174,7 +1186,8 @@ Other concrete types
1174
1186
``Match[bytes] ``. These types are also in the ``typing.re `` namespace.
1175
1187
1176
1188
.. deprecated :: 3.9
1177
- Classes ``Pattern `` and ``Match `` from :mod: `re ` now support ``[] ``. See :pep: `585 `.
1189
+ Classes ``Pattern `` and ``Match `` from :mod: `re ` now support ``[] ``.
1190
+ See :pep: `585 ` and :ref: `types-genericalias `.
1178
1191
1179
1192
.. class :: Text
1180
1193
@@ -1201,7 +1214,8 @@ Corresponding to collections in :mod:`collections.abc`
1201
1214
A generic version of :class: `collections.abc.Set `.
1202
1215
1203
1216
.. deprecated :: 3.9
1204
- :class: `collections.abc.Set ` now supports ``[] ``. See :pep: `585 `.
1217
+ :class: `collections.abc.Set ` now supports ``[] ``. See :pep: `585 ` and
1218
+ :ref: `types-genericalias `.
1205
1219
1206
1220
.. class :: ByteString(Sequence[int])
1207
1221
@@ -1214,7 +1228,8 @@ Corresponding to collections in :mod:`collections.abc`
1214
1228
annotate arguments of any of the types mentioned above.
1215
1229
1216
1230
.. deprecated :: 3.9
1217
- :class: `collections.abc.ByteString ` now supports ``[] ``. See :pep: `585 `.
1231
+ :class: `collections.abc.ByteString ` now supports ``[] ``. See :pep: `585 `
1232
+ and :ref: `types-genericalias `.
1218
1233
1219
1234
.. class :: Collection(Sized, Iterable[T_co], Container[T_co])
1220
1235
@@ -1223,28 +1238,32 @@ Corresponding to collections in :mod:`collections.abc`
1223
1238
.. versionadded :: 3.6.0
1224
1239
1225
1240
.. deprecated :: 3.9
1226
- :class: `collections.abc.Collection ` now supports ``[] ``. See :pep: `585 `.
1241
+ :class: `collections.abc.Collection ` now supports ``[] ``. See :pep: `585 `
1242
+ and :ref: `types-genericalias `.
1227
1243
1228
1244
.. class :: Container(Generic[T_co])
1229
1245
1230
1246
A generic version of :class: `collections.abc.Container `.
1231
1247
1232
1248
.. deprecated :: 3.9
1233
- :class: `collections.abc.Container ` now supports ``[] ``. See :pep: `585 `.
1249
+ :class: `collections.abc.Container ` now supports ``[] ``. See :pep: `585 `
1250
+ and :ref: `types-genericalias `.
1234
1251
1235
1252
.. class :: ItemsView(MappingView, Generic[KT_co, VT_co])
1236
1253
1237
1254
A generic version of :class: `collections.abc.ItemsView `.
1238
1255
1239
1256
.. deprecated :: 3.9
1240
- :class: `collections.abc.ItemsView ` now supports ``[] ``. See :pep: `585 `.
1257
+ :class: `collections.abc.ItemsView ` now supports ``[] ``. See :pep: `585 `
1258
+ and :ref: `types-genericalias `.
1241
1259
1242
1260
.. class :: KeysView(MappingView[KT_co], AbstractSet[KT_co])
1243
1261
1244
1262
A generic version of :class: `collections.abc.KeysView `.
1245
1263
1246
1264
.. deprecated :: 3.9
1247
- :class: `collections.abc.KeysView ` now supports ``[] ``. See :pep: `585 `.
1265
+ :class: `collections.abc.KeysView ` now supports ``[] ``. See :pep: `585 `
1266
+ and :ref: `types-genericalias `.
1248
1267
1249
1268
.. class :: Mapping(Sized, Collection[KT], Generic[VT_co])
1250
1269
@@ -1255,49 +1274,56 @@ Corresponding to collections in :mod:`collections.abc`
1255
1274
return word_list[word]
1256
1275
1257
1276
.. deprecated :: 3.9
1258
- :class: `collections.abc.Mapping ` now supports ``[] ``. See :pep: `585 `.
1277
+ :class: `collections.abc.Mapping ` now supports ``[] ``. See :pep: `585 `
1278
+ and :ref: `types-genericalias `.
1259
1279
1260
1280
.. class :: MappingView(Sized, Iterable[T_co])
1261
1281
1262
1282
A generic version of :class: `collections.abc.MappingView `.
1263
1283
1264
1284
.. deprecated :: 3.9
1265
- :class: `collections.abc.MappingView ` now supports ``[] ``. See :pep: `585 `.
1285
+ :class: `collections.abc.MappingView ` now supports ``[] ``. See :pep: `585 `
1286
+ and :ref: `types-genericalias `.
1266
1287
1267
1288
.. class :: MutableMapping(Mapping[KT, VT])
1268
1289
1269
1290
A generic version of :class: `collections.abc.MutableMapping `.
1270
1291
1271
1292
.. deprecated :: 3.9
1272
- :class: `collections.abc.MutableMapping ` now supports ``[] ``. See :pep: `585 `.
1293
+ :class: `collections.abc.MutableMapping ` now supports ``[] ``. See
1294
+ :pep: `585 ` and :ref: `types-genericalias `.
1273
1295
1274
1296
.. class :: MutableSequence(Sequence[T])
1275
1297
1276
1298
A generic version of :class: `collections.abc.MutableSequence `.
1277
1299
1278
1300
.. deprecated :: 3.9
1279
- :class: `collections.abc.MutableSequence ` now supports ``[] ``. See :pep: `585 `.
1301
+ :class: `collections.abc.MutableSequence ` now supports ``[] ``. See
1302
+ :pep: `585 ` and :ref: `types-genericalias `.
1280
1303
1281
1304
.. class :: MutableSet(AbstractSet[T])
1282
1305
1283
1306
A generic version of :class: `collections.abc.MutableSet `.
1284
1307
1285
1308
.. deprecated :: 3.9
1286
- :class: `collections.abc.MutableSet ` now supports ``[] ``. See :pep: `585 `.
1309
+ :class: `collections.abc.MutableSet ` now supports ``[] ``. See :pep: `585 `
1310
+ and :ref: `types-genericalias `.
1287
1311
1288
1312
.. class :: Sequence(Reversible[T_co], Collection[T_co])
1289
1313
1290
1314
A generic version of :class: `collections.abc.Sequence `.
1291
1315
1292
1316
.. deprecated :: 3.9
1293
- :class: `collections.abc.Sequence ` now supports ``[] ``. See :pep: `585 `.
1317
+ :class: `collections.abc.Sequence ` now supports ``[] ``. See :pep: `585 `
1318
+ and :ref: `types-genericalias `.
1294
1319
1295
1320
.. class :: ValuesView(MappingView[VT_co])
1296
1321
1297
1322
A generic version of :class: `collections.abc.ValuesView `.
1298
1323
1299
1324
.. deprecated :: 3.9
1300
- :class: `collections.abc.ValuesView ` now supports ``[] ``. See :pep: `585 `.
1325
+ :class: `collections.abc.ValuesView ` now supports ``[] ``. See :pep: `585 `
1326
+ and :ref: `types-genericalias `.
1301
1327
1302
1328
Corresponding to other types in :mod: `collections.abc `
1303
1329
""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -1307,14 +1333,16 @@ Corresponding to other types in :mod:`collections.abc`
1307
1333
A generic version of :class: `collections.abc.Iterable `.
1308
1334
1309
1335
.. deprecated :: 3.9
1310
- :class: `collections.abc.Iterable ` now supports ``[] ``. See :pep: `585 `.
1336
+ :class: `collections.abc.Iterable ` now supports ``[] ``. See :pep: `585 `
1337
+ and :ref: `types-genericalias `.
1311
1338
1312
1339
.. class :: Iterator(Iterable[T_co])
1313
1340
1314
1341
A generic version of :class: `collections.abc.Iterator `.
1315
1342
1316
1343
.. deprecated :: 3.9
1317
- :class: `collections.abc.Iterator ` now supports ``[] ``. See :pep: `585 `.
1344
+ :class: `collections.abc.Iterator ` now supports ``[] ``. See :pep: `585 `
1345
+ and :ref: `types-genericalias `.
1318
1346
1319
1347
.. class :: Generator(Iterator[T_co], Generic[T_co, T_contra, V_co])
1320
1348
@@ -1348,7 +1376,8 @@ Corresponding to other types in :mod:`collections.abc`
1348
1376
start += 1
1349
1377
1350
1378
.. deprecated :: 3.9
1351
- :class: `collections.abc.Generator ` now supports ``[] ``. See :pep: `585 `.
1379
+ :class: `collections.abc.Generator ` now supports ``[] ``. See :pep: `585 `
1380
+ and :ref: `types-genericalias `.
1352
1381
1353
1382
.. class :: Hashable
1354
1383
@@ -1359,7 +1388,8 @@ Corresponding to other types in :mod:`collections.abc`
1359
1388
A generic version of :class: `collections.abc.Reversible `.
1360
1389
1361
1390
.. deprecated :: 3.9
1362
- :class: `collections.abc.Reversible ` now supports ``[] ``. See :pep: `585 `.
1391
+ :class: `collections.abc.Reversible ` now supports ``[] ``. See :pep: `585 `
1392
+ and :ref: `types-genericalias `.
1363
1393
1364
1394
.. class :: Sized
1365
1395
@@ -1384,7 +1414,8 @@ Asynchronous programming
1384
1414
.. versionadded :: 3.5.3
1385
1415
1386
1416
.. deprecated :: 3.9
1387
- :class: `collections.abc.Coroutine ` now supports ``[] ``. See :pep: `585 `.
1417
+ :class: `collections.abc.Coroutine ` now supports ``[] ``. See :pep: `585 `
1418
+ and :ref: `types-genericalias `.
1388
1419
1389
1420
.. class :: AsyncGenerator(AsyncIterator[T_co], Generic[T_co, T_contra])
1390
1421
@@ -1420,7 +1451,8 @@ Asynchronous programming
1420
1451
.. versionadded :: 3.6.1
1421
1452
1422
1453
.. deprecated :: 3.9
1423
- :class: `collections.abc.AsyncGenerator ` now supports ``[] ``. See :pep: `585 `.
1454
+ :class: `collections.abc.AsyncGenerator ` now supports ``[] ``. See
1455
+ :pep: `585 ` and :ref: `types-genericalias `.
1424
1456
1425
1457
.. class :: AsyncIterable(Generic[T_co])
1426
1458
@@ -1429,7 +1461,8 @@ Asynchronous programming
1429
1461
.. versionadded :: 3.5.2
1430
1462
1431
1463
.. deprecated :: 3.9
1432
- :class: `collections.abc.AsyncIterable ` now supports ``[] ``. See :pep: `585 `.
1464
+ :class: `collections.abc.AsyncIterable ` now supports ``[] ``. See :pep: `585 `
1465
+ and :ref: `types-genericalias `.
1433
1466
1434
1467
.. class :: AsyncIterator(AsyncIterable[T_co])
1435
1468
@@ -1438,7 +1471,8 @@ Asynchronous programming
1438
1471
.. versionadded :: 3.5.2
1439
1472
1440
1473
.. deprecated :: 3.9
1441
- :class: `collections.abc.AsyncIterator ` now supports ``[] ``. See :pep: `585 `.
1474
+ :class: `collections.abc.AsyncIterator ` now supports ``[] ``. See :pep: `585 `
1475
+ and :ref: `types-genericalias `.
1442
1476
1443
1477
.. class :: Awaitable(Generic[T_co])
1444
1478
@@ -1447,7 +1481,8 @@ Asynchronous programming
1447
1481
.. versionadded :: 3.5.2
1448
1482
1449
1483
.. deprecated :: 3.9
1450
- :class: `collections.abc.Awaitable ` now supports ``[] ``. See :pep: `585 `.
1484
+ :class: `collections.abc.Awaitable ` now supports ``[] ``. See :pep: `585 `
1485
+ and :ref: `types-genericalias `.
1451
1486
1452
1487
1453
1488
Context manager types
@@ -1461,7 +1496,8 @@ Context manager types
1461
1496
.. versionadded :: 3.6.0
1462
1497
1463
1498
.. deprecated :: 3.9
1464
- :class: `contextlib.AbstractContextManager ` now supports ``[] ``. See :pep: `585 `.
1499
+ :class: `contextlib.AbstractContextManager ` now supports ``[] ``. See
1500
+ :pep: `585 ` and :ref: `types-genericalias `.
1465
1501
1466
1502
.. class :: AsyncContextManager(Generic[T_co])
1467
1503
@@ -1471,7 +1507,8 @@ Context manager types
1471
1507
.. versionadded :: 3.6.2
1472
1508
1473
1509
.. deprecated :: 3.9
1474
- :class: `contextlib.AbstractAsyncContextManager ` now supports ``[] ``. See :pep: `585 `.
1510
+ :class: `contextlib.AbstractAsyncContextManager ` now supports ``[] ``. See
1511
+ :pep: `585 ` and :ref: `types-genericalias `.
1475
1512
1476
1513
Protocols
1477
1514
---------
0 commit comments