@@ -631,8 +631,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
631
631
is equivalent to ``Tuple[Any, ...] ``, and in turn to :class: `tuple `.
632
632
633
633
.. deprecated :: 3.9
634
- :class: `builtins.tuple <tuple> ` now supports ``[] ``. See :pep: ` 585 ` and
635
- :ref: `types-genericalias `.
634
+ :class: `builtins.tuple <tuple> ` now supports subscripting ( ``[] ``).
635
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
636
636
637
637
.. data :: Union
638
638
@@ -720,8 +720,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
720
720
respectively.
721
721
722
722
.. deprecated :: 3.9
723
- :class: `collections.abc.Callable ` now supports ``[] ``. See :pep: ` 585 ` and
724
- :ref: `types-genericalias `.
723
+ :class: `collections.abc.Callable ` now supports subscripting ( ``[] ``).
724
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
725
725
726
726
.. versionchanged :: 3.10
727
727
``Callable `` now supports :class: `ParamSpec ` and :data: `Concatenate `.
@@ -827,8 +827,8 @@ These can be used as types in annotations using ``[]``, each having a unique syn
827
827
.. versionadded :: 3.5.2
828
828
829
829
.. deprecated :: 3.9
830
- :class: `builtins.type <type> ` now supports ``[] ``. See :pep: ` 585 ` and
831
- :ref: `types-genericalias `.
830
+ :class: `builtins.type <type> ` now supports subscripting ( ``[] ``).
831
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
832
832
833
833
.. data :: Literal
834
834
@@ -1597,8 +1597,8 @@ Corresponding to built-in types
1597
1597
...
1598
1598
1599
1599
.. deprecated :: 3.9
1600
- :class: `builtins.dict <dict> ` now supports ``[] ``. See :pep: ` 585 ` and
1601
- :ref: `types-genericalias `.
1600
+ :class: `builtins.dict <dict> ` now supports subscripting ( ``[] ``).
1601
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1602
1602
1603
1603
.. class :: List(list, MutableSequence[T])
1604
1604
@@ -1618,8 +1618,8 @@ Corresponding to built-in types
1618
1618
return [item for item in vector if item > 0]
1619
1619
1620
1620
.. deprecated :: 3.9
1621
- :class: `builtins.list <list> ` now supports ``[] ``. See :pep: ` 585 ` and
1622
- :ref: `types-genericalias `.
1621
+ :class: `builtins.list <list> ` now supports subscripting ( ``[] ``).
1622
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1623
1623
1624
1624
.. class :: Set(set, MutableSet[T])
1625
1625
@@ -1628,16 +1628,17 @@ Corresponding to built-in types
1628
1628
to use an abstract collection type such as :class: `AbstractSet `.
1629
1629
1630
1630
.. deprecated :: 3.9
1631
- :class: `builtins.set <set> ` now supports ``[] ``. See :pep: ` 585 ` and
1632
- :ref: `types-genericalias `.
1631
+ :class: `builtins.set <set> ` now supports subscripting ( ``[] ``).
1632
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1633
1633
1634
1634
.. class :: FrozenSet(frozenset, AbstractSet[T_co])
1635
1635
1636
1636
A generic version of :class: `builtins.frozenset <frozenset> `.
1637
1637
1638
1638
.. deprecated :: 3.9
1639
- :class: `builtins.frozenset <frozenset> ` now supports ``[] ``. See
1640
- :pep: `585 ` and :ref: `types-genericalias `.
1639
+ :class: `builtins.frozenset <frozenset> `
1640
+ now supports subscripting (``[] ``).
1641
+ See :pep: `585 ` and :ref: `types-genericalias `.
1641
1642
1642
1643
.. note :: :data:`Tuple` is a special form.
1643
1644
@@ -1651,8 +1652,8 @@ Corresponding to types in :mod:`collections`
1651
1652
.. versionadded :: 3.5.2
1652
1653
1653
1654
.. deprecated :: 3.9
1654
- :class: `collections.defaultdict ` now supports ``[] ``. See :pep: ` 585 ` and
1655
- :ref: `types-genericalias `.
1655
+ :class: `collections.defaultdict ` now supports subscripting ( ``[] ``).
1656
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1656
1657
1657
1658
.. class :: OrderedDict(collections.OrderedDict, MutableMapping[KT, VT])
1658
1659
@@ -1661,8 +1662,8 @@ Corresponding to types in :mod:`collections`
1661
1662
.. versionadded :: 3.7.2
1662
1663
1663
1664
.. deprecated :: 3.9
1664
- :class: `collections.OrderedDict ` now supports ``[] ``. See :pep: ` 585 ` and
1665
- :ref: `types-genericalias `.
1665
+ :class: `collections.OrderedDict ` now supports subscripting ( ``[] ``).
1666
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1666
1667
1667
1668
.. class :: ChainMap(collections.ChainMap, MutableMapping[KT, VT])
1668
1669
@@ -1672,8 +1673,8 @@ Corresponding to types in :mod:`collections`
1672
1673
.. versionadded :: 3.6.1
1673
1674
1674
1675
.. deprecated :: 3.9
1675
- :class: `collections.ChainMap ` now supports ``[] ``. See :pep: ` 585 ` and
1676
- :ref: `types-genericalias `.
1676
+ :class: `collections.ChainMap ` now supports subscripting ( ``[] ``).
1677
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1677
1678
1678
1679
.. class :: Counter(collections.Counter, Dict[T, int])
1679
1680
@@ -1683,8 +1684,8 @@ Corresponding to types in :mod:`collections`
1683
1684
.. versionadded :: 3.6.1
1684
1685
1685
1686
.. deprecated :: 3.9
1686
- :class: `collections.Counter ` now supports ``[] ``. See :pep: ` 585 ` and
1687
- :ref: `types-genericalias `.
1687
+ :class: `collections.Counter ` now supports subscripting ( ``[] ``).
1688
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1688
1689
1689
1690
.. class :: Deque(deque, MutableSequence[T])
1690
1691
@@ -1694,8 +1695,8 @@ Corresponding to types in :mod:`collections`
1694
1695
.. versionadded :: 3.6.1
1695
1696
1696
1697
.. deprecated :: 3.9
1697
- :class: `collections.deque ` now supports ``[] ``. See :pep: ` 585 ` and
1698
- :ref: `types-genericalias `.
1698
+ :class: `collections.deque ` now supports subscripting ( ``[] ``).
1699
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1699
1700
1700
1701
Other concrete types
1701
1702
""""""""""""""""""""
@@ -1756,8 +1757,8 @@ Corresponding to collections in :mod:`collections.abc`
1756
1757
A generic version of :class: `collections.abc.Set `.
1757
1758
1758
1759
.. deprecated :: 3.9
1759
- :class: `collections.abc.Set ` now supports ``[] ``. See :pep: ` 585 ` and
1760
- :ref: `types-genericalias `.
1760
+ :class: `collections.abc.Set ` now supports subscripting ( ``[] ``).
1761
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1761
1762
1762
1763
.. class :: ByteString(Sequence[int])
1763
1764
@@ -1770,8 +1771,8 @@ Corresponding to collections in :mod:`collections.abc`
1770
1771
annotate arguments of any of the types mentioned above.
1771
1772
1772
1773
.. deprecated :: 3.9
1773
- :class: `collections.abc.ByteString ` now supports ``[] ``. See :pep: ` 585 `
1774
- and :ref: `types-genericalias `.
1774
+ :class: `collections.abc.ByteString ` now supports subscripting ( ``[] ``).
1775
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1775
1776
1776
1777
.. class :: Collection(Sized, Iterable[T_co], Container[T_co])
1777
1778
@@ -1780,32 +1781,32 @@ Corresponding to collections in :mod:`collections.abc`
1780
1781
.. versionadded :: 3.6.0
1781
1782
1782
1783
.. deprecated :: 3.9
1783
- :class: `collections.abc.Collection ` now supports ``[] ``. See :pep: ` 585 `
1784
- and :ref: `types-genericalias `.
1784
+ :class: `collections.abc.Collection ` now supports subscripting ( ``[] ``).
1785
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1785
1786
1786
1787
.. class :: Container(Generic[T_co])
1787
1788
1788
1789
A generic version of :class: `collections.abc.Container `.
1789
1790
1790
1791
.. deprecated :: 3.9
1791
- :class: `collections.abc.Container ` now supports ``[] ``. See :pep: ` 585 `
1792
- and :ref: `types-genericalias `.
1792
+ :class: `collections.abc.Container ` now supports subscripting ( ``[] ``).
1793
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1793
1794
1794
1795
.. class :: ItemsView(MappingView, AbstractSet[tuple[KT_co, VT_co]])
1795
1796
1796
1797
A generic version of :class: `collections.abc.ItemsView `.
1797
1798
1798
1799
.. deprecated :: 3.9
1799
- :class: `collections.abc.ItemsView ` now supports ``[] ``. See :pep: ` 585 `
1800
- and :ref: `types-genericalias `.
1800
+ :class: `collections.abc.ItemsView ` now supports subscripting ( ``[] ``).
1801
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1801
1802
1802
1803
.. class :: KeysView(MappingView, AbstractSet[KT_co])
1803
1804
1804
1805
A generic version of :class: `collections.abc.KeysView `.
1805
1806
1806
1807
.. deprecated :: 3.9
1807
- :class: `collections.abc.KeysView ` now supports ``[] ``. See :pep: ` 585 `
1808
- and :ref: `types-genericalias `.
1808
+ :class: `collections.abc.KeysView ` now supports subscripting ( ``[] ``).
1809
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1809
1810
1810
1811
.. class :: Mapping(Sized, Collection[KT], Generic[VT_co])
1811
1812
@@ -1816,56 +1817,58 @@ Corresponding to collections in :mod:`collections.abc`
1816
1817
return word_list[word]
1817
1818
1818
1819
.. deprecated :: 3.9
1819
- :class: `collections.abc.Mapping ` now supports ``[] ``. See :pep: ` 585 `
1820
- and :ref: `types-genericalias `.
1820
+ :class: `collections.abc.Mapping ` now supports subscripting ( ``[] ``).
1821
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1821
1822
1822
1823
.. class :: MappingView(Sized)
1823
1824
1824
1825
A generic version of :class: `collections.abc.MappingView `.
1825
1826
1826
1827
.. deprecated :: 3.9
1827
- :class: `collections.abc.MappingView ` now supports ``[] ``. See :pep: ` 585 `
1828
- and :ref: `types-genericalias `.
1828
+ :class: `collections.abc.MappingView ` now supports subscripting ( ``[] ``).
1829
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1829
1830
1830
1831
.. class :: MutableMapping(Mapping[KT, VT])
1831
1832
1832
1833
A generic version of :class: `collections.abc.MutableMapping `.
1833
1834
1834
1835
.. deprecated :: 3.9
1835
- :class: `collections.abc.MutableMapping ` now supports ``[] ``. See
1836
- :pep: `585 ` and :ref: `types-genericalias `.
1836
+ :class: `collections.abc.MutableMapping `
1837
+ now supports subscripting (``[] ``).
1838
+ See :pep: `585 ` and :ref: `types-genericalias `.
1837
1839
1838
1840
.. class :: MutableSequence(Sequence[T])
1839
1841
1840
1842
A generic version of :class: `collections.abc.MutableSequence `.
1841
1843
1842
1844
.. deprecated :: 3.9
1843
- :class: `collections.abc.MutableSequence ` now supports ``[] ``. See
1844
- :pep: `585 ` and :ref: `types-genericalias `.
1845
+ :class: `collections.abc.MutableSequence `
1846
+ now supports subscripting (``[] ``).
1847
+ See :pep: `585 ` and :ref: `types-genericalias `.
1845
1848
1846
1849
.. class :: MutableSet(AbstractSet[T])
1847
1850
1848
1851
A generic version of :class: `collections.abc.MutableSet `.
1849
1852
1850
1853
.. deprecated :: 3.9
1851
- :class: `collections.abc.MutableSet ` now supports ``[] ``. See :pep: ` 585 `
1852
- and :ref: `types-genericalias `.
1854
+ :class: `collections.abc.MutableSet ` now supports subscripting ( ``[] ``).
1855
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1853
1856
1854
1857
.. class :: Sequence(Reversible[T_co], Collection[T_co])
1855
1858
1856
1859
A generic version of :class: `collections.abc.Sequence `.
1857
1860
1858
1861
.. deprecated :: 3.9
1859
- :class: `collections.abc.Sequence ` now supports ``[] ``. See :pep: ` 585 `
1860
- and :ref: `types-genericalias `.
1862
+ :class: `collections.abc.Sequence ` now supports subscripting ( ``[] ``).
1863
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1861
1864
1862
1865
.. class :: ValuesView(MappingView, Collection[_VT_co])
1863
1866
1864
1867
A generic version of :class: `collections.abc.ValuesView `.
1865
1868
1866
1869
.. deprecated :: 3.9
1867
- :class: `collections.abc.ValuesView ` now supports ``[] ``. See :pep: ` 585 `
1868
- and :ref: `types-genericalias `.
1870
+ :class: `collections.abc.ValuesView ` now supports subscripting ( ``[] ``).
1871
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1869
1872
1870
1873
Corresponding to other types in :mod: `collections.abc `
1871
1874
""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -1875,16 +1878,16 @@ Corresponding to other types in :mod:`collections.abc`
1875
1878
A generic version of :class: `collections.abc.Iterable `.
1876
1879
1877
1880
.. deprecated :: 3.9
1878
- :class: `collections.abc.Iterable ` now supports ``[] ``. See :pep: ` 585 `
1879
- and :ref: `types-genericalias `.
1881
+ :class: `collections.abc.Iterable ` now supports subscripting ( ``[] ``).
1882
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1880
1883
1881
1884
.. class :: Iterator(Iterable[T_co])
1882
1885
1883
1886
A generic version of :class: `collections.abc.Iterator `.
1884
1887
1885
1888
.. deprecated :: 3.9
1886
- :class: `collections.abc.Iterator ` now supports ``[] ``. See :pep: ` 585 `
1887
- and :ref: `types-genericalias `.
1889
+ :class: `collections.abc.Iterator ` now supports subscripting ( ``[] ``).
1890
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1888
1891
1889
1892
.. class :: Generator(Iterator[T_co], Generic[T_co, T_contra, V_co])
1890
1893
@@ -1918,8 +1921,8 @@ Corresponding to other types in :mod:`collections.abc`
1918
1921
start += 1
1919
1922
1920
1923
.. deprecated :: 3.9
1921
- :class: `collections.abc.Generator ` now supports ``[] ``. See :pep: ` 585 `
1922
- and :ref: `types-genericalias `.
1924
+ :class: `collections.abc.Generator ` now supports subscripting ( ``[] ``).
1925
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1923
1926
1924
1927
.. class :: Hashable
1925
1928
@@ -1930,8 +1933,8 @@ Corresponding to other types in :mod:`collections.abc`
1930
1933
A generic version of :class: `collections.abc.Reversible `.
1931
1934
1932
1935
.. deprecated :: 3.9
1933
- :class: `collections.abc.Reversible ` now supports ``[] ``. See :pep: ` 585 `
1934
- and :ref: `types-genericalias `.
1936
+ :class: `collections.abc.Reversible ` now supports subscripting ( ``[] ``).
1937
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1935
1938
1936
1939
.. class :: Sized
1937
1940
@@ -1955,8 +1958,8 @@ Asynchronous programming
1955
1958
.. versionadded :: 3.5.3
1956
1959
1957
1960
.. deprecated :: 3.9
1958
- :class: `collections.abc.Coroutine ` now supports ``[] ``. See :pep: ` 585 `
1959
- and :ref: `types-genericalias `.
1961
+ :class: `collections.abc.Coroutine ` now supports subscripting ( ``[] ``).
1962
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
1960
1963
1961
1964
.. class :: AsyncGenerator(AsyncIterator[T_co], Generic[T_co, T_contra])
1962
1965
@@ -1992,8 +1995,9 @@ Asynchronous programming
1992
1995
.. versionadded :: 3.6.1
1993
1996
1994
1997
.. deprecated :: 3.9
1995
- :class: `collections.abc.AsyncGenerator ` now supports ``[] ``. See
1996
- :pep: `585 ` and :ref: `types-genericalias `.
1998
+ :class: `collections.abc.AsyncGenerator `
1999
+ now supports subscripting (``[] ``).
2000
+ See :pep: `585 ` and :ref: `types-genericalias `.
1997
2001
1998
2002
.. class :: AsyncIterable(Generic[T_co])
1999
2003
@@ -2002,8 +2006,8 @@ Asynchronous programming
2002
2006
.. versionadded :: 3.5.2
2003
2007
2004
2008
.. deprecated :: 3.9
2005
- :class: `collections.abc.AsyncIterable ` now supports ``[] ``. See :pep: ` 585 `
2006
- and :ref: `types-genericalias `.
2009
+ :class: `collections.abc.AsyncIterable ` now supports subscripting ( ``[] ``).
2010
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2007
2011
2008
2012
.. class :: AsyncIterator(AsyncIterable[T_co])
2009
2013
@@ -2012,8 +2016,8 @@ Asynchronous programming
2012
2016
.. versionadded :: 3.5.2
2013
2017
2014
2018
.. deprecated :: 3.9
2015
- :class: `collections.abc.AsyncIterator ` now supports ``[] ``. See :pep: ` 585 `
2016
- and :ref: `types-genericalias `.
2019
+ :class: `collections.abc.AsyncIterator ` now supports subscripting ( ``[] ``).
2020
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2017
2021
2018
2022
.. class :: Awaitable(Generic[T_co])
2019
2023
@@ -2022,8 +2026,8 @@ Asynchronous programming
2022
2026
.. versionadded :: 3.5.2
2023
2027
2024
2028
.. deprecated :: 3.9
2025
- :class: `collections.abc.Awaitable ` now supports ``[] ``. See :pep: ` 585 `
2026
- and :ref: `types-genericalias `.
2029
+ :class: `collections.abc.Awaitable ` now supports subscripting ( ``[] ``).
2030
+ See :pep: ` 585 ` and :ref: `types-genericalias `.
2027
2031
2028
2032
2029
2033
Context manager types
@@ -2037,8 +2041,9 @@ Context manager types
2037
2041
.. versionadded :: 3.6.0
2038
2042
2039
2043
.. deprecated :: 3.9
2040
- :class: `contextlib.AbstractContextManager ` now supports ``[] ``. See
2041
- :pep: `585 ` and :ref: `types-genericalias `.
2044
+ :class: `contextlib.AbstractContextManager `
2045
+ now supports subscripting (``[] ``).
2046
+ See :pep: `585 ` and :ref: `types-genericalias `.
2042
2047
2043
2048
.. class :: AsyncContextManager(Generic[T_co])
2044
2049
@@ -2048,8 +2053,9 @@ Context manager types
2048
2053
.. versionadded :: 3.6.2
2049
2054
2050
2055
.. deprecated :: 3.9
2051
- :class: `contextlib.AbstractAsyncContextManager ` now supports ``[] ``. See
2052
- :pep: `585 ` and :ref: `types-genericalias `.
2056
+ :class: `contextlib.AbstractAsyncContextManager `
2057
+ now supports subscripting (``[] ``).
2058
+ See :pep: `585 ` and :ref: `types-genericalias `.
2053
2059
2054
2060
Protocols
2055
2061
---------
0 commit comments