classes — reading what ai just wrote you7 / 9
@dataclass — the class shape ai ships in every modern python project
AI wrote a Coord dataclass meant to be a value object — never
mutated after construction. The decorator is plain @dataclass,
which leaves it mutable, so the line origin.x = 999 silently
succeeds when it shouldn't.
Add frozen=True to the decorator on line 3 so the assignment
raises FrozenInstanceError. The except block catches it and prints
the class name.
Expected output:
blocked: FrozenInstanceError
The break is on line 3 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _