-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint ruletype-inferenceRequires more advanced type inference.Requires more advanced type inference.
Description
Summary
Frozen dataclasses and attrs objects should be considered immutable.
@attrs.frozen
class A:
foo: int = 1
@attrs.frozen
class B:
a: A = A() # should be valid, but gives RUF009
@dataclasses.dataclass(frozen=True)
class C:
foo: int = 1
@dataclasses.dataclass(frozen=True)
class D:
d: C = C() # should be valid , but gives RUF009Version
v0.11.5
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint ruletype-inferenceRequires more advanced type inference.Requires more advanced type inference.