python' mutablemapping abstract base class section provides an introduction to the concept of an abstract base class and the role of such classes in python' collections module methods that are declared to be abstract in such base class must be implemented by concrete subclasses howeveran abstract base class may provide concrete implementation of other methods that depend upon use of the presumed abstract methods (this is an example of the template method design pattern the collections module provides two abstract base classes that are relevant to our current discussionthe mapping and mutablemapping classes the mapping class includes all nonmutating methods supported by python' dict classwhile the mutablemapping class extends that to include the mutating methods what we define as the map adt in section is akin to the mutablemapping abstract base class in python' collections module the significance of these abstract base classes is that they provide framework to assist in creating user-defined map class in particularthe mutablemapping class provides concrete implementations for all behaviors other than the first five outlined in section getitem setitem delitem len and iter as we implement the map abstraction with various data structuresas long as we provide the five core behaviorswe can inherit all other derived behaviors by simply declaring mutablemapping as parent class to better understand the mutablemapping classwe provide few examples of how concrete behaviors can be derived from the five core abstractions for examplethe contains methodsupporting the syntax in mcould be implemented by making guarded attempt to retrieve self[kto determine if the key exists def contains (selfk)tryself[kreturn true except keyerrorreturn false access via getitem (ignore resultattempt failed similar approach might be used to provide the logic of the setdefault method def setdefault(selfkd)tryreturn self[kexcept keyerrorself[kd return if getitem succeedsreturn value otherwiseset default value with setitem and return that newly assigned value we leave as exercises the implementations of the remaining concrete methods of the mutablemapping class