promptdojo_

@dataclass — the class shape AI ships in every modern Python project — step 7 of 9

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.

full-screen editor opens — close anytime to keep reading.