interface objects in our scriptsbut might instead create them at runtime according to the contents of configuration file such file might simply give the string name of stream class to be imported from moduleplus an optional constructor call argument factory-style functions or code might come in handy here because they would allow us to fetch and pass in classes that are not hardcoded in our program ahead of time indeedthose classes might not even have existed at all when we wrote our codeclassname parse from config file classarg parse from config file import streamtypes aclass getattr(streamtypesclassnamereader factory(aclassclassargprocessor(readercustomizable code fetch from module or aclass(classargherethe getattr built-in is again used to fetch module attribute given string name (it' like saying obj attrbut attr is stringbecause this code snippet assumes single constructor argumentit doesn' strictly need factory--we could make an instance with just aclass(classargthe factory function may prove more useful in the presence of unknown argument listshoweverand the general factory coding pattern can improve the code' flexibility multiple inheritance"mix-inclasses our last design pattern is one of the most usefuland will serve as subject for more realistic example to wrap up this and point toward the next as bonusthe code we'll write here may be useful tool many class-based designs call for combining disparate sets of methods as we've seenin class statementmore than one superclass can be listed in parentheses in the header line when you do thisyou leverage multiple inheritance--the class and its instances inherit names from all the listed superclasses when searching for an attributepython' inheritance search traverses all superclasses in the class header from left to right until match is found technicallybecause any of the superclasses may have superclasses of its ownthis search can be bit more complex for larger class treesin classic classes (the default until python )the attribute search in all cases proceeds depth-first all the way to the top of the inheritance treeand then from left to right this order is usually called dflrfor its depth-firstleft-to-right path in new-style classes (optional in and standard in )the attribute search is usually as beforebut in diamond patterns proceeds across by tree levels before moving upin more breadth-first fashion this order is usually called the new designing with classes