Skip to main content

Practice ยท 2 of 2

Two Storages, One Interface

Implement MemoryStorage (dict-backed) and class PrefixedStorage wrapping another storage and adding 'p:' to every key on save and load (delegation + composition). Both satisfy the Storage protocol from the lesson.

Difficulty: intermediate

Back to lesson: Practice: Protocol Drills