the second advanced technique is the use of the @abstractmethod decorator immediately before the len and getitem methods are declared that declares these two particular methods to be abstractmeaning that we do not provide an implementation within our sequence base classbut that we expect any concrete subclasses to support those two methods python enforces this expectationby disallowing instantiation for any subclass that does not override the abstract methods with concrete implementations the rest of the sequence class definition provides tangible implementations for other behaviorsunder the assumption that the abstract len and getitem methods will exist in concrete subclass if you carefully examine the source codethe implementations of methods contains indexand count do not rely on any assumption about the self instancesother than that syntax len(selfand self[jare supported (by special methods len and getitem respectivelysupport for iteration is automatic as wellas described in section in the remainder of this bookwe omit the formality of using the abc module if we need an "abstractbase classwe simply document the expectation that subclasses provide assumed functionalitywithout technical declaration of the methods as abstract but we will make use of the wonderful abstract base classes that are defined within the collections module (such as sequenceto use such classwe need only rely on standard inheritance techniques for exampleour range classfrom code fragment of section is an example of class that supports the len and getitem methods but that class does not support methods count or index had we originally declared it with sequence as superclassthen it would also inherit the count and index methods the syntax for such declaration would begin asclass range(collections sequence)finallywe emphasize that if subclass provides its own implementation of an inherited behaviors from base classthe new definition overrides the inherited one this technique can be used when we have the ability to provide more efficient implementation for behavior than is achieved by the generic approach as an examplethe general implementation of contains for sequence is based on loop used to search for the desired value for our range classthere is an opportunity for more efficient determination of containment for exampleit is evident that the expression in range( )should evaluate to trueeven without examining the individual elements of the rangebecause the range starts with zerohas an increment of and goes until millionit must include as that is multiple of that is between the start and stop values exercise - explores the goal of providing an implementation of range contains that avoids the use of (time-consumingloop