Python’s ChainMap reads mappings in order but sends assignments to the first mapping, so replacing a fallback value creates an override instead of changing its original dictionary.
Python’s ChainMap combines multiple dictionaries for lookup, but it does not route a write back to whichever dictionary supplied the value. When a key exists only in a fallback mapping, assigning through the ChainMap places the new value in its first mapping and leaves the fallback unchanged.
Deleting a key also operates on the first mapping rather than searching later mappings. Removing a local override can therefore reveal the fallback value, while attempting to delete a key that exists only in a later mapping raises KeyError.
The examples also distinguish mapping assignment from mutation of a retrieved object. Appending to a list returned from a fallback changes that shared list even though the first mapping remains empty. A child ChainMap adds a new front layer while continuing to see changes in shared parent mappings.
These behaviors make ChainMap useful for temporary overrides, but applications should choose a write target explicitly rather than assuming the combined view updates the dictionary that supplied a value. The supplied exercises use ordinary in-memory dictionaries and do not establish persistence, access control, transactions or isolation.