-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix attrs.evolve on bound TypeVar (#15022)
Fixes the error on the last line of this example: ```python @attrs.define class A: x: int T = TypeVar('T', bound=A) def f(t: T) -> None: _ = attrs.evolve(t, x=42) # E: Argument 1 to "evolve" has incompatible type "T"; expected an attrs class ``` Since `T` is bounded by `A`, we know it can be treated as `A`.
- Loading branch information
Showing
2 changed files
with
85 additions
and
8 deletions.
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