Open
Description
Bug Report
attrs 24.3.0 added support for __replace__
in python-attrs/attrs#1383. mypy doesn't like it.
To Reproduce
import copy
from attrs import define
@define
class Foo:
one: int
foo = Foo(1)
bar = copy.replace(foo, one=2)
Actual Behavior
a.py:12: error: Value of type variable "_SR" of "replace" cannot be "Foo" [type-var]
Your Environment
- Mypy version used: 1.13.0
- Mypy command-line flags:
mypy .
- Mypy configuration options from
mypy.ini
(and other config files): N/A - Python version used: 3.13.1
Package Version
----------------- -------
attrs 24.3.0
mypy 1.13.0
mypy-extensions 1.0.0
typing-extensions 4.12.2