Python Forum
Child class inheritance issue
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Child class inheritance issue
#4
This code executes when the class C code is parsed, not when an instance of the class is made.
print("Just inside class C")
I know that classes A, B and C are all just examples, but they are horrible examples. If C inherits from classes A and B, it would be because both A and B have things to offer that are different from each other and C should call the __init__() methods for both A and B.

This is a pretty good, short article about multiple inheritance in Python.

https://stackoverflow.com/questions/9575...-right-way
Reply


Messages In This Thread
Child class inheritance issue - by eakanathan - Apr-21-2022, 09:32 AM
RE: Child class inheritance issue - by menator01 - Apr-21-2022, 10:28 AM
RE: Child class inheritance issue - by deanhystad - Apr-21-2022, 12:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python inner classes inheritance from parent class Abedin 8 1,385 Apr-23-2025, 05:56 AM
Last Post: Gribouillis
  printing/out put issue with class arabuamir 3 1,176 Aug-25-2024, 09:29 AM
Last Post: arabuamir
  super() and order of running method in class inheritance akbarza 7 2,685 Feb-04-2024, 09:35 AM
Last Post: Gribouillis
Question __init__ of Child Class zero_fX0 4 6,349 Mar-22-2023, 05:23 PM
Last Post: deanhystad
  Using one child class method in another child class garynewport 5 3,409 Jan-11-2023, 06:07 PM
Last Post: garynewport
  Importing issues with base class for inheritance riccardoob 5 8,101 May-19-2021, 05:18 PM
Last Post: snippsat
  3D vector class with inheritance from 2D vector class buss0140 4 4,559 Dec-20-2020, 08:44 PM
Last Post: deanhystad
  Class inheritance oclmedyb 3 3,200 Dec-09-2020, 04:43 PM
Last Post: deanhystad
  Can we access instance variable of parent class in child class using inheritance akdube 3 16,044 Nov-13-2020, 03:43 AM
Last Post: SalsaBeanDip
  Issue referencing new instance from other class nanok66 3 3,110 Jul-31-2020, 02:07 AM
Last Post: nanok66

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020