sequenceinstead of inheriting the abc (as we showed earlier)we can simply register the sortedlist as collections sequenceclass sortedlistcollections sequence register(sortedlistafter the class is defined normallywe register it with the collections sequence abc registering class like this makes it virtual subclass virtual subclass reports that it is subclass of the class or classes it is registered with ( using isinstance(or issubclass())but does not inherit any data or methods from any of the classes it is registered with registering class like this provides promise that the class provides the api of the classes it is registered withbut does not provide any guarantee that it will honor its promise one use of metaclasses is to provide both promise and guarantee about class' api another use is to modify class in some way (like class decorator doesand of coursemetaclasses can be used for both purposes at the same time suppose we want to create group of classes that all provide load(and save(methods we can do this by creating class that when used as metaclasschecks that these methods are presentclass loadablesaveable(type)def __init__(clsclassnamebasesdictionary)super(__init__(classnamebasesdictionaryassert hasattr(cls"load"and isinstance(getattr(cls"load")collections callable)("class 'classname "must provide load(method"assert hasattr(cls"save"and isinstance(getattr(cls"save")collections callable)("class 'classname "must provide save(method"classes that are to serve as metaclasses must inherit from the ultimate metaclass base classtypeor one of its subclasses note that this class is called when classes that use it are instantiatedin all probability not very oftenso the runtime cost is extremely low notice also that we must perform the checks after the class has been created (using the super(call)since only then will the class' attributes be available in the class itself (the attributes are in the dictionarybut we prefer to work on the actual initialized class when doing checks in python terminologyvirtual does not mean the same thing as it does in +terminology