Introduction to interface definition and abstract classes and abstract methods in python
# _ * _ Coding: UTF-8 _ * _ # Knowledge Point: Interface definition and abstract classes and abstract methods ''' 1. what is the abstract class type? Abstract classes and abstract methods are equivalent to interfaces 2. definitions of interfaces 1. users expose a URL to you and call the URL. 2. define a specification without writing specific implementations, according to this specification, the abstract class belongs to this ''' from abc import ABCMeta, abstractmethod # defines an abstract class Alert: _ metaclass _ = ABCMeta @ abstractmethod def Send (self): pass # Abstract method class Foo (Alert): # inherit abstract classes (or inherited interfaces ), in this case, def _ init _ (self): print '_ init _' def Send (self): # The send method is used in the abstract class. therefore, the send method print 'send. weixin 'F = Foo () f. send ()