Skip to content
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

specify type parameters for base class of HTTPHeaders #3329

Conversation

mslynch
Copy link
Contributor

@mslynch mslynch commented Sep 28, 2023

Resolves #3328.

@mslynch mslynch force-pushed the httpheaders-mutablemapping-type-params branch from 34711d0 to 4d34def Compare September 28, 2023 17:45
@mslynch mslynch marked this pull request as ready for review September 28, 2023 18:25
Comment on lines +65 to +68
StrMutableMapping = collections.abc.MutableMapping[str, str]
else:
StrMutableMapping = collections.abc.MutableMapping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Python 3.8 doesn't support type parameters on MutableMapping, but mypy/Pyright know how to handle them. Once Python 3.8 support is dropped, they can go right in the class definition: HTTPHeaders(collections.abc.MutableMapping[str, str]).

@bdarnell
Copy link
Member

bdarnell commented Jun 7, 2024

Thanks! This required a few other changes but I've got a PR coming shortly that fixes this.

@bdarnell bdarnell closed this in e7dff51 Jun 7, 2024
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.

Inaccurate typing on HTTPHeaders
2 participants