Python - Class Inheritance

Card Puncher Data Processing

About

Object - Inheritance in Python

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

See Python Type - Dynamic Class

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.





Discover More
Card Puncher Data Processing
Python - Class

in Python The difference with a standard class implementation is that in Python, Classes are objects because the class keyword will creates an object. Only a class object is capable of creating objects....
Card Puncher Data Processing
Python Type - Dynamic Class

With the three arguments of the type function, you can create dynamically a new class (ie a type object). type is a class that creates class objects...



Share this page:
Follow us:
Task Runner