def name(self)pass the definition of an abstract class needs to set its metaclass to abcmeta as shown (alsobe aware that the syntax differs between python and this is required because the implementation of abstract classes relies on metaclass (described in the next sectionwithin the abstract classthe @abstractmethod and @abstractproperty decorators specify that method or property must be implemented by subclasses of foo an abstract class is not meant to be instantiated directly if you try to create foo for the previous classyou will get the following errorf foo(traceback (most recent call last)file ""line in typeerrorcan' instantiate abstract class foo with abstract methods spam this restriction carries over to derived classes as well for instanceif you have class bar that inherits from foo but it doesn' implement one or more of the abstract methodsattempts to create bar will fail with similar error because of this added checkingabstract classes are useful to programmers who want to make assertions on the methods and properties that must be implemented on subclasses although an abstract class enforces rules about methods and properties that must be implementedit does not perform conformance checking on arguments or return values thusan abstract class will not check subclass to see whether method has used the same arguments as an abstract method likewisean abstract class that requires the definition of property does not check to see whether the property in subclass supports the same set of operations (getsetand deleteof the property specified in base although an abstract class can not be instantiatedit can define methods and properties for use in subclasses moreoveran abstract method in the base can still be called from subclass for examplecalling foo spam( ,bfrom the subclass is allowed abstract base classes allow preexisting classes to be registered as belonging to that base this is done using the register(method as followsclass grok(object)def spam(self, , )print("grok spam"foo register(grokregister with foo abstract base class when class is registered with an abstract basetype-checking operations involving the abstract base (such as isinstance(and issubclass()will return true for instances of the registered class when class is registered with an abstract classno checks are made to see whether the class actually implements any of the abstract methods or properties this registration process only affects type-checking it does not add extra error checking to the class that is registered unlike many other object-oriented languagespython' built-in types are organized into relatively flat hierarchy for exampleif you look at the built-in types such as int or floatthey directly inherit from objectthe root of all objectsinstead of an intermediate base class representing numbers this makes it clumsy to write programs that want to inspect and manipulate objects based on generic category such as simply being an instance of number lib fl ff