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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mslynch
Copy link

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

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
1 participant