mypy
cc7b0620 - Fix attrs.evolve on bound TypeVar (#15022)

Commit
3 years ago
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`.
Author
Parents
Loading