attrs: remove fields type check#15983
Merged
hauntsaninja merged 1 commit intopython:masterfrom Aug 30, 2023
Merged
Conversation
8d9cfc1 to
0bca9e9
Compare
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: prefect (https://github.com/PrefectHQ/prefect): typechecking got 1.10x slower (110.1s -> 120.5s)
(Performance measurements are based on a single noisy sample)
|
Contributor
Author
|
@sobolevn this is along the same lines as #15962 btw, the reason why I'm not culling the same code (wrote it at the same time...) for |
1 task
Contributor
|
@ikonst haha thanks for this, I had it on my mental checklist |
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.
Since python-attrs/attrs#890 (≥ 22.1.0)
attrs.fieldsis typed to accept a protocol.Since python-attrs/attrs#997 (≥ 22.2.0)
attrs.hasis a type-guard.Support both by removing the explicit error reporting and letting it fall through to the type stub.
Fixes #15980.