promptdojo_

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

Claude wrote a dataclass with a literal [] as a default. The class definition itself raises ValueError: mutable default .... The fix is field(default_factory=list).

field is already imported on line 1. Replace the broken default on line 6 so the class defines successfully and the print at the bottom shows an empty list per instance.

Expected output:

Inbox(owner='maya', messages=[])
Inbox(owner='marcus', messages=[])
The break is on line 6 — but read the whole snippet first.

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