-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-98500: Fix typing docs for *View
classes
#98511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Doc/library/typing.rst
Outdated
@@ -2096,15 +2096,15 @@ 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]], Generic[KT_co, VT_co]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic is redundant as a base class, because there is a generic base. Other classes nearby don't list Generic as an explicit base, so these ones shouldn't either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I feel like the fact that so many typeshed classes do this in the stubs is something of a legacy thing (though some may prefer it for added explicitness).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
GH-98611 is a backport of this pull request to the 3.11 branch. |
GH-98612 is a backport of this pull request to the 3.10 branch. |
(cherry picked from commit 1a217f9) Co-authored-by: Nikita Sobolev <[email protected]>
(cherry picked from commit 1a217f9) Co-authored-by: Nikita Sobolev <[email protected]>
Thank you! I've noticed some other docs-related problems. Will do later this week. |
(cherry picked from commit 1a217f9) Co-authored-by: Nikita Sobolev <[email protected]>
(cherry picked from commit 1a217f9) Co-authored-by: Nikita Sobolev <[email protected]>
typing.MappingView
andtyping.ItemsView
on several versions of CPython #98500