Skip to content

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

Merged
merged 2 commits into from
Oct 24, 2022

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Oct 21, 2022

@@ -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])
Copy link
Member

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.

Copy link
Member

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).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@JelleZijlstra JelleZijlstra added needs backport to 3.10 only security fixes needs backport to 3.11 only security fixes labels Oct 24, 2022
@JelleZijlstra JelleZijlstra merged commit 1a217f9 into python:main Oct 24, 2022
@miss-islington
Copy link
Contributor

Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-98611 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Oct 24, 2022
@bedevere-bot
Copy link

GH-98612 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Oct 24, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 24, 2022
(cherry picked from commit 1a217f9)

Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 24, 2022
(cherry picked from commit 1a217f9)

Co-authored-by: Nikita Sobolev <[email protected]>
@sobolevn
Copy link
Member Author

Thank you! I've noticed some other docs-related problems. Will do later this week.

miss-islington added a commit that referenced this pull request Oct 24, 2022
(cherry picked from commit 1a217f9)

Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington added a commit that referenced this pull request Oct 24, 2022
(cherry picked from commit 1a217f9)

Co-authored-by: Nikita Sobolev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants