]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-98500: Fix typing docs for `*View` classes (GH-98511)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 24 Oct 2022 17:54:35 +0000 (10:54 -0700)
committerGitHub <noreply@github.com>
Mon, 24 Oct 2022 17:54:35 +0000 (10:54 -0700)
(cherry picked from commit 1a217f9ffc6d014536c08d7fb0136d117b8a0add)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Doc/library/typing.rst

index 198bc880f9d78e7856d5472e908a0d804b01f72a..41571035a3a952fb2b5ac2153148762a0abfb4da 100644 (file)
@@ -1791,7 +1791,7 @@ Corresponding to collections in :mod:`collections.abc`
       :class:`collections.abc.Container` now supports ``[]``. See :pep:`585`
       and :ref:`types-genericalias`.
 
-.. class:: ItemsView(MappingView, Generic[KT_co, VT_co])
+.. class:: ItemsView(MappingView, AbstractSet[tuple[KT_co, VT_co]])
 
    A generic version of :class:`collections.abc.ItemsView`.
 
@@ -1799,7 +1799,7 @@ Corresponding to collections in :mod:`collections.abc`
       :class:`collections.abc.ItemsView` now supports ``[]``. See :pep:`585`
       and :ref:`types-genericalias`.
 
-.. class:: KeysView(MappingView[KT_co], AbstractSet[KT_co])
+.. class:: KeysView(MappingView, AbstractSet[KT_co])
 
    A generic version of :class:`collections.abc.KeysView`.
 
@@ -1819,7 +1819,7 @@ Corresponding to collections in :mod:`collections.abc`
       :class:`collections.abc.Mapping` now supports ``[]``. See :pep:`585`
       and :ref:`types-genericalias`.
 
-.. class:: MappingView(Sized, Iterable[T_co])
+.. class:: MappingView(Sized)
 
    A generic version of :class:`collections.abc.MappingView`.
 
@@ -1859,7 +1859,7 @@ Corresponding to collections in :mod:`collections.abc`
       :class:`collections.abc.Sequence` now supports ``[]``. See :pep:`585`
       and :ref:`types-genericalias`.
 
-.. class:: ValuesView(MappingView[VT_co])
+.. class:: ValuesView(MappingView, Collection[_VT_co])
 
    A generic version of :class:`collections.abc.ValuesView`.