Skip to main content

Practice ยท 1 of 1

InMemoryOrderRepository

Implement InMemoryOrderRepository: - nested exception OrderNotFound - save(order) stores a COPY of the order dict (keyed by order['id']) - get(order_id) returns a COPY; unknown id raises OrderNotFound - all() returns a list of copies Graded probe: mutating the dict you received from get() must NOT change repository state โ€” storage leaks through shared references are the classic repository bug.

Difficulty: advanced

Back to lesson: Practice: Repository Practice