Default argument expressions are evaluated once when the def statement executes, not on each function call. Every call without an explicit items argument shares and mutates the exact same list object. Fix it by defaulting to None and initializing items = [] inside the body.
Follow-up Interview Question · What is the equivalent pitfall inside a @dataclass with list fields?