-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add signature for attr.evolve (#14526)
Validate `attr.evolve` calls to specify correct arguments and types. The implementation makes it so that at every point where `attr.evolve` is called, the signature is modified to expect the attrs class' initializer's arguments (but so that they're all kw-only and optional). Notes: - Added `class dict: pass` to some fixtures files since our attrs type stubs now have **kwargs and that triggers a `builtin.dict` lookup in dozens of attrs tests. - Looking up the type of the 1st argument with `ctx.api.expr_checker.accept(inst_arg)` which is a hack since it's not part of the plugin API. This is a compromise for due to #10216. Fixes #14525.
- Loading branch information
Showing
5 changed files
with
159 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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