instances by attribute references and expressions additionallyit defines the __get attr__ special method to intercept references to attributes not defined in the class and to route them to the wrapped list object (to support list methodssortappendreverseand so onmany of the module' operations become operators in the class table - shows the equivalence of module and class operations (columns and and gives the class method that comes into play for each (column table - module/class operation comparison module operations class operations class method module empty(not instance __len__ module member(xx in instance __getitem__ module item(iinstance[i__getitem__ module length(len(instance__len__ module dump(print(instance__repr__ range(counter loops for in instance __getitem__ manual loop logic instance instance __add__ module stack reverse(instance reverse(__getattr__ module push/pop/top instance push/pop/top push/pop/top in effectclasses let us extend python' set of built-in types with reusable types implemented in python modules class-based types may be used just like built-in typesdepending on which operation methods they defineclasses can implement numbersmappingsand sequencesand may or may not be mutable class-based types may also fall somewhere in between these categories customizationperformance monitors so far we've seen how classes support multiple instances and integrate better with python' object model by defining operator methods one of the other main reasons for using classes is to allow for future extensions and customizations by implementing stacks with classwe can later add subclasses that specialize the implementation for new demands in factthis is often the main reason for using custom class instead of built-in alternative for instancesuppose we've started using the stack class in example - but we start running into performance problems one way to isolate bottlenecks is to instrument data structures with logic that keeps track of usage statisticswhich we can analyze after running client applications because stack is classwe can add such logic in new subclass without affecting the original stack module (or its clientsthe subclass in example - extends stack to keep track of overall push/pop usage frequencies and to record the maximum size of each instance data structures