Merged
Conversation
* Replace some ABCs with concrete types or protocols. * Use `LiteralString` in some instances.
AlexWaygood
reviewed
Apr 8, 2026
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: pandas (https://github.com/pandas-dev/pandas)
- pandas/core/computation/ops.py:328: error: Need type annotation for "_binary_ops_dict" (hint: "_binary_ops_dict: dict[<type>, <type>] = ...") [var-annotated]
|
AlexWaygood
approved these changes
Apr 8, 2026
Member
AlexWaygood
left a comment
There was a problem hiding this comment.
not totally sure about some of the Mapping -> dict and Sequence -> list changes (see inline comment), but this basically LGTM
| default_allowed_algs: Sequence[str] | ||
| default_max_plaintext_size: int | ||
|
|
||
| JWEHeaderRegistry: dict[LiteralString, JWSEHeaderParameter] |
Member
There was a problem hiding this comment.
I assume this was deliberately typed as Mapping rather than dict before to reflect the fact that you're probably not really meant to mutate it? I don't feel strongly, though
Collaborator
Author
There was a problem hiding this comment.
Possibly, but that would need at least a comment. And I'm not sure why you would need to prevent that. On the other hand, these are not marked as Final, so "readonly", but not Final seems incomplete in any case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LiteralStringin some instances.Closes: #15628