@@ -760,8 +760,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
760
760
is equivalent to ``Tuple[Any, ...] ``, and in turn to :class: `tuple `.
761
761
762
762
.. deprecated :: 3.9
763
- :class: `builtins.tuple <tuple> ` now supports ``[] ``. See :pep: ` 585 ` and
764
- :ref: `types-genericalias `.
763
+ :class: `builtins.tuple <tuple> ` now supports subscripting ( ``[] ``).
764
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
765
765
766
766
.. data :: Union
767
767
@@ -849,8 +849,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
849
849
respectively.
850
850
851
851
.. deprecated :: 3.9
852
- :class: `collections.abc.Callable ` now supports ``[] ``. See :pep: ` 585 ` and
853
- :ref: `types-genericalias `.
852
+ :class: `collections.abc.Callable ` now supports subscripting ( ``[] ``).
853
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
854
854
855
855
.. versionchanged :: 3.10
856
856
``Callable `` now supports :class: `ParamSpec ` and :data: `Concatenate `.
@@ -957,8 +957,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
957
957
.. versionadded :: 3.5.2
958
958
959
959
.. deprecated :: 3.9
960
- :class: `builtins.type <type> ` now supports ``[] ``. See :pep: ` 585 ` and
961
- :ref: `types-genericalias `.
960
+ :class: `builtins.type <type> ` now supports subscripting ( ``[] ``).
961
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
962
962
963
963
.. data :: Literal
964
964
@@ -1896,8 +1896,8 @@ Corresponding to built-in types
1896
1896
...
1897
1897
1898
1898
.. deprecated :: 3.9
1899
- :class: `builtins.dict <dict> ` now supports ``[] ``. See :pep: ` 585 ` and
1900
- :ref: `types-genericalias `.
1899
+ :class: `builtins.dict <dict> ` now supports subscripting ( ``[] ``).
1900
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1901
1901
1902
1902
.. class :: List(list, MutableSequence[T])
1903
1903
@@ -1917,8 +1917,8 @@ Corresponding to built-in types
1917
1917
return [item for item in vector if item > 0]
1918
1918
1919
1919
.. deprecated :: 3.9
1920
- :class: `builtins.list <list> ` now supports ``[] ``. See :pep: ` 585 ` and
1921
- :ref: `types-genericalias `.
1920
+ :class: `builtins.list <list> ` now supports subscripting ( ``[] ``).
1921
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1922
1922
1923
1923
.. class :: Set(set, MutableSet[T])
1924
1924
@@ -1927,16 +1927,17 @@ Corresponding to built-in types
1927
1927
to use an abstract collection type such as :class: `AbstractSet `.
1928
1928
1929
1929
.. deprecated :: 3.9
1930
- :class: `builtins.set <set> ` now supports ``[] ``. See :pep: ` 585 ` and
1931
- :ref: `types-genericalias `.
1930
+ :class: `builtins.set <set> ` now supports subscripting ( ``[] ``).
1931
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1932
1932
1933
1933
.. class :: FrozenSet(frozenset, AbstractSet[T_co])
1934
1934
1935
1935
A generic version of :class: `builtins.frozenset <frozenset> `.
1936
1936
1937
1937
.. deprecated :: 3.9
1938
- :class: `builtins.frozenset <frozenset> ` now supports ``[] ``. See
1939
- :pep: `585 ` and :ref: `types-genericalias `.
1938
+ :class: `builtins.frozenset <frozenset> `
1939
+ now supports subscripting (``[] ``).
1940
+ See :pep: `585 ` and :ref: `types-genericalias `.
1940
1941
1941
1942
.. note :: :data:`Tuple` is a special form.
1942
1943
@@ -1950,8 +1951,8 @@ Corresponding to types in :mod:`collections`
1950
1951
.. versionadded :: 3.5.2
1951
1952
1952
1953
.. deprecated :: 3.9
1953
- :class: `collections.defaultdict ` now supports ``[] ``. See :pep: ` 585 ` and
1954
- :ref: `types-genericalias `.
1954
+ :class: `collections.defaultdict ` now supports subscripting ( ``[] ``).
1955
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1955
1956
1956
1957
.. class :: OrderedDict(collections.OrderedDict, MutableMapping[KT, VT])
1957
1958
@@ -1960,8 +1961,8 @@ Corresponding to types in :mod:`collections`
1960
1961
.. versionadded :: 3.7.2
1961
1962
1962
1963
.. deprecated :: 3.9
1963
- :class: `collections.OrderedDict ` now supports ``[] ``. See :pep: ` 585 ` and
1964
- :ref: `types-genericalias `.
1964
+ :class: `collections.OrderedDict ` now supports subscripting ( ``[] ``).
1965
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1965
1966
1966
1967
.. class :: ChainMap(collections.ChainMap, MutableMapping[KT, VT])
1967
1968
@@ -1971,8 +1972,8 @@ Corresponding to types in :mod:`collections`
1971
1972
.. versionadded :: 3.6.1
1972
1973
1973
1974
.. deprecated :: 3.9
1974
- :class: `collections.ChainMap ` now supports ``[] ``. See :pep: ` 585 ` and
1975
- :ref: `types-genericalias `.
1975
+ :class: `collections.ChainMap ` now supports subscripting ( ``[] ``).
1976
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1976
1977
1977
1978
.. class :: Counter(collections.Counter, Dict[T, int])
1978
1979
@@ -1982,8 +1983,8 @@ Corresponding to types in :mod:`collections`
1982
1983
.. versionadded :: 3.6.1
1983
1984
1984
1985
.. deprecated :: 3.9
1985
- :class: `collections.Counter ` now supports ``[] ``. See :pep: ` 585 ` and
1986
- :ref: `types-genericalias `.
1986
+ :class: `collections.Counter ` now supports subscripting ( ``[] ``).
1987
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1987
1988
1988
1989
.. class :: Deque(deque, MutableSequence[T])
1989
1990
@@ -1993,8 +1994,8 @@ Corresponding to types in :mod:`collections`
1993
1994
.. versionadded :: 3.6.1
1994
1995
1995
1996
.. deprecated :: 3.9
1996
- :class: `collections.deque ` now supports ``[] ``. See :pep: ` 585 ` and
1997
- :ref: `types-genericalias `.
1997
+ :class: `collections.deque ` now supports subscripting ( ``[] ``).
1998
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1998
1999
1999
2000
Other concrete types
2000
2001
""""""""""""""""""""
@@ -2061,8 +2062,8 @@ Corresponding to collections in :mod:`collections.abc`
2061
2062
A generic version of :class: `collections.abc.Set `.
2062
2063
2063
2064
.. deprecated :: 3.9
2064
- :class: `collections.abc.Set ` now supports ``[] ``. See :pep: ` 585 ` and
2065
- :ref: `types-genericalias `.
2065
+ :class: `collections.abc.Set ` now supports subscripting ( ``[] ``).
2066
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2066
2067
2067
2068
.. class :: ByteString(Sequence[int])
2068
2069
@@ -2075,8 +2076,8 @@ Corresponding to collections in :mod:`collections.abc`
2075
2076
annotate arguments of any of the types mentioned above.
2076
2077
2077
2078
.. deprecated :: 3.9
2078
- :class: `collections.abc.ByteString ` now supports ``[] ``. See :pep: ` 585 `
2079
- and :ref: `types-genericalias `.
2079
+ :class: `collections.abc.ByteString ` now supports subscripting ( ``[] ``).
2080
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2080
2081
2081
2082
.. class :: Collection(Sized, Iterable[T_co], Container[T_co])
2082
2083
@@ -2085,32 +2086,32 @@ Corresponding to collections in :mod:`collections.abc`
2085
2086
.. versionadded :: 3.6.0
2086
2087
2087
2088
.. deprecated :: 3.9
2088
- :class: `collections.abc.Collection ` now supports ``[] ``. See :pep: ` 585 `
2089
- and :ref: `types-genericalias `.
2089
+ :class: `collections.abc.Collection ` now supports subscripting ( ``[] ``).
2090
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2090
2091
2091
2092
.. class :: Container(Generic[T_co])
2092
2093
2093
2094
A generic version of :class: `collections.abc.Container `.
2094
2095
2095
2096
.. deprecated :: 3.9
2096
- :class: `collections.abc.Container ` now supports ``[] ``. See :pep: ` 585 `
2097
- and :ref: `types-genericalias `.
2097
+ :class: `collections.abc.Container ` now supports subscripting ( ``[] ``).
2098
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2098
2099
2099
2100
.. class :: ItemsView(MappingView, AbstractSet[tuple[KT_co, VT_co]])
2100
2101
2101
2102
A generic version of :class: `collections.abc.ItemsView `.
2102
2103
2103
2104
.. deprecated :: 3.9
2104
- :class: `collections.abc.ItemsView ` now supports ``[] ``. See :pep: ` 585 `
2105
- and :ref: `types-genericalias `.
2105
+ :class: `collections.abc.ItemsView ` now supports subscripting ( ``[] ``).
2106
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2106
2107
2107
2108
.. class :: KeysView(MappingView, AbstractSet[KT_co])
2108
2109
2109
2110
A generic version of :class: `collections.abc.KeysView `.
2110
2111
2111
2112
.. deprecated :: 3.9
2112
- :class: `collections.abc.KeysView ` now supports ``[] ``. See :pep: ` 585 `
2113
- and :ref: `types-genericalias `.
2113
+ :class: `collections.abc.KeysView ` now supports subscripting ( ``[] ``).
2114
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2114
2115
2115
2116
.. class :: Mapping(Sized, Collection[KT], Generic[VT_co])
2116
2117
@@ -2121,56 +2122,58 @@ Corresponding to collections in :mod:`collections.abc`
2121
2122
return word_list[word]
2122
2123
2123
2124
.. deprecated :: 3.9
2124
- :class: `collections.abc.Mapping ` now supports ``[] ``. See :pep: ` 585 `
2125
- and :ref: `types-genericalias `.
2125
+ :class: `collections.abc.Mapping ` now supports subscripting ( ``[] ``).
2126
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2126
2127
2127
2128
.. class :: MappingView(Sized)
2128
2129
2129
2130
A generic version of :class: `collections.abc.MappingView `.
2130
2131
2131
2132
.. deprecated :: 3.9
2132
- :class: `collections.abc.MappingView ` now supports ``[] ``. See :pep: ` 585 `
2133
- and :ref: `types-genericalias `.
2133
+ :class: `collections.abc.MappingView ` now supports subscripting ( ``[] ``).
2134
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2134
2135
2135
2136
.. class :: MutableMapping(Mapping[KT, VT])
2136
2137
2137
2138
A generic version of :class: `collections.abc.MutableMapping `.
2138
2139
2139
2140
.. deprecated :: 3.9
2140
- :class: `collections.abc.MutableMapping ` now supports ``[] ``. See
2141
- :pep: `585 ` and :ref: `types-genericalias `.
2141
+ :class: `collections.abc.MutableMapping `
2142
+ now supports subscripting (``[] ``).
2143
+ See :pep: `585 ` and :ref: `types-genericalias `.
2142
2144
2143
2145
.. class :: MutableSequence(Sequence[T])
2144
2146
2145
2147
A generic version of :class: `collections.abc.MutableSequence `.
2146
2148
2147
2149
.. deprecated :: 3.9
2148
- :class: `collections.abc.MutableSequence ` now supports ``[] ``. See
2149
- :pep: `585 ` and :ref: `types-genericalias `.
2150
+ :class: `collections.abc.MutableSequence `
2151
+ now supports subscripting (``[] ``).
2152
+ See :pep: `585 ` and :ref: `types-genericalias `.
2150
2153
2151
2154
.. class :: MutableSet(AbstractSet[T])
2152
2155
2153
2156
A generic version of :class: `collections.abc.MutableSet `.
2154
2157
2155
2158
.. deprecated :: 3.9
2156
- :class: `collections.abc.MutableSet ` now supports ``[] ``. See :pep: ` 585 `
2157
- and :ref: `types-genericalias `.
2159
+ :class: `collections.abc.MutableSet ` now supports subscripting ( ``[] ``).
2160
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2158
2161
2159
2162
.. class :: Sequence(Reversible[T_co], Collection[T_co])
2160
2163
2161
2164
A generic version of :class: `collections.abc.Sequence `.
2162
2165
2163
2166
.. deprecated :: 3.9
2164
- :class: `collections.abc.Sequence ` now supports ``[] ``. See :pep: ` 585 `
2165
- and :ref: `types-genericalias `.
2167
+ :class: `collections.abc.Sequence ` now supports subscripting ( ``[] ``).
2168
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2166
2169
2167
2170
.. class :: ValuesView(MappingView, Collection[_VT_co])
2168
2171
2169
2172
A generic version of :class: `collections.abc.ValuesView `.
2170
2173
2171
2174
.. deprecated :: 3.9
2172
- :class: `collections.abc.ValuesView ` now supports ``[] ``. See :pep: ` 585 `
2173
- and :ref: `types-genericalias `.
2175
+ :class: `collections.abc.ValuesView ` now supports subscripting ( ``[] ``).
2176
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2174
2177
2175
2178
Corresponding to other types in :mod: `collections.abc `
2176
2179
""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -2180,16 +2183,16 @@ Corresponding to other types in :mod:`collections.abc`
2180
2183
A generic version of :class:`collections.abc.Iterable `.
2181
2184
2182
2185
.. deprecated :: 3.9
2183
- :class: `collections.abc.Iterable ` now supports ``[] ``. See :pep: ` 585 `
2184
- and :ref: `types-genericalias `.
2186
+ :class: `collections.abc.Iterable ` now supports subscripting ( ``[] ``).
2187
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2185
2188
2186
2189
.. class :: Iterator(Iterable[T_co])
2187
2190
2188
2191
A generic version of :class: `collections.abc.Iterator `.
2189
2192
2190
2193
.. deprecated :: 3.9
2191
- :class: `collections.abc.Iterator ` now supports ``[] ``. See :pep: ` 585 `
2192
- and :ref: `types-genericalias `.
2194
+ :class: `collections.abc.Iterator ` now supports subscripting ( ``[] ``).
2195
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2193
2196
2194
2197
.. class :: Generator(Iterator[T_co], Generic[T_co, T_contra, V_co])
2195
2198
@@ -2223,8 +2226,8 @@ Corresponding to other types in :mod:`collections.abc`
2223
2226
start += 1
2224
2227
2225
2228
.. deprecated :: 3.9
2226
- :class: `collections.abc.Generator ` now supports ``[] ``. See :pep: ` 585 `
2227
- and :ref: `types-genericalias `.
2229
+ :class: `collections.abc.Generator ` now supports subscripting ( ``[] ``).
2230
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2228
2231
2229
2232
.. class :: Hashable
2230
2233
@@ -2235,8 +2238,8 @@ Corresponding to other types in :mod:`collections.abc`
2235
2238
A generic version of :class: `collections.abc.Reversible `.
2236
2239
2237
2240
.. deprecated :: 3.9
2238
- :class: `collections.abc.Reversible ` now supports ``[] ``. See :pep: ` 585 `
2239
- and :ref: `types-genericalias `.
2241
+ :class: `collections.abc.Reversible ` now supports subscripting ( ``[] ``).
2242
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2240
2243
2241
2244
.. class :: Sized
2242
2245
@@ -2260,8 +2263,8 @@ Asynchronous programming
2260
2263
.. versionadded :: 3.5.3
2261
2264
2262
2265
.. deprecated :: 3.9
2263
- :class: `collections.abc.Coroutine ` now supports ``[] ``. See :pep: ` 585 `
2264
- and :ref: `types-genericalias `.
2266
+ :class: `collections.abc.Coroutine ` now supports subscripting ( ``[] ``).
2267
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2265
2268
2266
2269
.. class :: AsyncGenerator(AsyncIterator[T_co], Generic[T_co, T_contra])
2267
2270
@@ -2297,8 +2300,9 @@ Asynchronous programming
2297
2300
.. versionadded :: 3.6.1
2298
2301
2299
2302
.. deprecated :: 3.9
2300
- :class: `collections.abc.AsyncGenerator ` now supports ``[] ``. See
2301
- :pep: `585 ` and :ref: `types-genericalias `.
2303
+ :class: `collections.abc.AsyncGenerator `
2304
+ now supports subscripting (``[] ``).
2305
+ See :pep: `585 ` and :ref: `types-genericalias `.
2302
2306
2303
2307
.. class :: AsyncIterable(Generic[T_co])
2304
2308
@@ -2307,8 +2311,8 @@ Asynchronous programming
2307
2311
.. versionadded :: 3.5.2
2308
2312
2309
2313
.. deprecated :: 3.9
2310
- :class: `collections.abc.AsyncIterable ` now supports ``[] ``. See :pep: ` 585 `
2311
- and :ref: `types-genericalias `.
2314
+ :class: `collections.abc.AsyncIterable ` now supports subscripting ( ``[] ``).
2315
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2312
2316
2313
2317
.. class :: AsyncIterator(AsyncIterable[T_co])
2314
2318
@@ -2317,8 +2321,8 @@ Asynchronous programming
2317
2321
.. versionadded :: 3.5.2
2318
2322
2319
2323
.. deprecated :: 3.9
2320
- :class: `collections.abc.AsyncIterator ` now supports ``[] ``. See :pep: ` 585 `
2321
- and :ref: `types-genericalias `.
2324
+ :class: `collections.abc.AsyncIterator ` now supports subscripting ( ``[] ``).
2325
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2322
2326
2323
2327
.. class :: Awaitable(Generic[T_co])
2324
2328
@@ -2327,8 +2331,8 @@ Asynchronous programming
2327
2331
.. versionadded :: 3.5.2
2328
2332
2329
2333
.. deprecated :: 3.9
2330
- :class: `collections.abc.Awaitable ` now supports ``[] ``. See :pep: ` 585 `
2331
- and :ref: `types-genericalias `.
2334
+ :class: `collections.abc.Awaitable ` now supports subscripting ( ``[] ``).
2335
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2332
2336
2333
2337
2334
2338
Context manager types
@@ -2342,8 +2346,9 @@ Context manager types
2342
2346
.. versionadded :: 3.6.0
2343
2347
2344
2348
.. deprecated :: 3.9
2345
- :class: `contextlib.AbstractContextManager ` now supports ``[] ``. See
2346
- :pep: `585 ` and :ref: `types-genericalias `.
2349
+ :class: `contextlib.AbstractContextManager `
2350
+ now supports subscripting (``[] ``).
2351
+ See :pep: `585 ` and :ref: `types-genericalias `.
2347
2352
2348
2353
.. class :: AsyncContextManager(Generic[T_co])
2349
2354
@@ -2353,8 +2358,9 @@ Context manager types
2353
2358
.. versionadded :: 3.6.2
2354
2359
2355
2360
.. deprecated :: 3.9
2356
- :class: `contextlib.AbstractAsyncContextManager ` now supports ``[] ``. See
2357
- :pep: `585 ` and :ref: `types-genericalias `.
2361
+ :class: `contextlib.AbstractAsyncContextManager `
2362
+ now supports subscripting (``[] ``).
2363
+ See :pep: `585 ` and :ref: `types-genericalias `.
2358
2364
2359
2365
Protocols
2360
2366
---------
0 commit comments