our mapbase class we will be providing many different implementations of the map adtin the remainder of this and nextusing variety of data structures demonstrating trade-off of advantages and disadvantages figure provides preview of those classes the mutablemapping abstract base classfrom python' collections module and discussed in the preceding pagesis valuable tool when implementing map howeverin the interest of greater code reusewe define our own mapbase classwhich is itself subclass of the mutablemapping class our mapbase class provides additional support for the composition design pattern this is technique we introduced when implementing priority queue (see section in order to group key-value pair as single instance for internal use more formallyour mapbase class is defined in code fragment extending the existing mutablemapping abstract base class so that we inherit the many useful concrete methods that class provides we then define nonpublic nested item classwhose instances are able to store both key and value this nested class is reasonably similar in design to the item class that was defined within our priorityqueuebase class in section except that for map we provide support for both equality tests and comparisonsboth of which rely on the item' key the notion of equality is necessary for all of our map implementationsas way to determine whether key given as parameter is equivalent to one that is already stored in the map the notion of comparisons between keysusing the operatorwill become relevant when we later introduce sorted map adt (section mutablemapping (collections modulemapbase (section unsortedtablemap (section hashmapbase (section sortedtablemap (section treemap ((additional subclasseschainhashmap (section probehashmap (section figure our hierarchy of map types (with references to where they are defined