@dataclass(frozen=True, slots=True)
class C:
i: int
C(10).j = 5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 5, in __setattr__
TypeError: super(type, obj): obj must be an instance or subtype of type
instead of raising a FrozenInstanceError.
@dataclass(frozen=True, slots=True)
class C:
i: int
class D(C):
pass
D(10).j = 5
crashes with the same error instead of working.