abstract base classes when defining group of classes as part of an inheritance hierarchyone technique for avoiding repetition of code is to design base class with common functionality that can be inherited by other classes that need it as an examplethe hierarchy from section includes progression classwhich serves as base class for three distinct subclassesarithmeticprogressiongeometricprogressionand fibonacciprogression although it is possible to create an instance of the progression base classthere is little value in doing so because its behavior is simply special case of an arithmeticprogression with increment the real purpose of the progression class was to centralize the implementations of behaviors that other progressions neededthereby streamlining the code that is relegated to those subclasses in classic object-oriented terminologywe say class is an abstract base class if its only purpose is to serve as base class through inheritance more formallyan abstract base class is one that cannot be directly instantiatedwhile concrete class is one that can be instantiated by this definitionour progression class is technically concretealthough we essentially designed it as an abstract base class in statically typed languages such as java and ++an abstract base class serves as formal type that may guarantee one or more abstract methods this provides support for polymorphismas variable may have an abstract base class as its declared typeeven though it refers to an instance of concrete subclass because there are no declared types in pythonthis kind of polymorphism can be accomplished without the need for unifying abstract base class for this reasonthere is not as strong tradition of defining abstract base classes in pythonalthough python' abc module provides support for defining formal abstract base class our reason for focusing on abstract base classes in our study of data structures is that python' collections module provides several abstract base classes that assist when defining custom data structures that share common interface with some of python' built-in data structures these rely on an object-oriented software design pattern known as the template method pattern the template method pattern is when an abstract base class provides concrete behaviors that rely upon calls to other abstract behaviors in that wayas soon as subclass provides definitions for the missing abstract behaviorsthe inherited concrete behaviors are well defined as tangible examplethe collections sequence abstract base class defines behaviors common to python' liststrand tuple classesas sequences that support element access via an integer index more sothe collections sequence class provides concrete implementations of methodscountindexand contains that can be inherited by any class that provides concrete implementations of both len and getitem for the purpose of illustrationwe provide sample implementation of such sequence abstract base class in code fragment