Python - Class Inheritance

About

Management

Creation

Class keyword

class DerivedClass(BaseClass)

where:

  • the derived class is the new class
  • and the base class is the class from which that new class inherits.

Dynamic

Access

To directly access the attributes or methods of a superclass, use the built-in super function.

class DerivedClass(Base):
   def some_method(self):
       super(DerivedClass, self).methode()

where:

  • meth() is a method from the base class.

Powered by ComboStrap