Mypy should special case these functions to only work with dataclasses.
from dataclasses import dataclass, replace
@dataclass
class D:
pass
class C:
pass
replace(D())
replace(C()) # TypeError: replace() should be called on dataclass instances
playground
PS: PyCharm correctly reports these