Skip to content

Remove pytype workarounds from third-party stubs #14471

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
Jul 27, 2025

Conversation

srittau
Copy link
Collaborator

@srittau srittau commented Jul 27, 2025

Cf. #11958

# Using Hashable instead of HashableT to work around pytype issue
_AggFuncTypeDictFrame: TypeAlias = Mapping[Hashable, _AggFuncTypeBase | list[_AggFuncTypeBase]]
Copy link
Member

Choose a reason for hiding this comment

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

doesn't this comment imply that we should try using HashableT here? 😄

Copy link
Collaborator Author

@srittau srittau Jul 27, 2025

Choose a reason for hiding this comment

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

Yes, but HashableT doesn't exist in any of the seaborn stubs (or _typeshed). So I'm not sure what introducing it here would look like. I assume this is an old comment that's become obsolete due to changes to the stubs in the meantime.

Copy link
Member

Choose a reason for hiding this comment

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

The comment was added in #10974. It looks like @Avasam originally tried to use HashableT from pandas._typing in that PR, but switched to using Hashable to placate some pytype issues in this commit on the PR branch ("fix pytype"): b25381c

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure making the type alias generic would actually have any practical user-facing difference to what you have, though. So I'm okay with landing this PR as you currently have it!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah that sounds about right

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 981bd8e into python:main Jul 27, 2025
48 checks passed
@srittau srittau deleted the rm-pyright-workarounds2 branch July 27, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy