Home python python redefinition of the parent method

python redefinition of the parent method

Author

Date

Category

There is a standard inheritance procedure:

class parent:
  Def __init __ (Self, * Args):
    Self._subconstructor ()
  DEF _SUBCONSTRUCTOR (SELF):
    Pass
Class Child (Parent):
  Def __init __ (Self, * Args):
    Super () .__ init __ (* Args)

Is it possible in this case to override the behavior of the _subconstructor method>from the class Child without overriding __ init __ Parent class method?


Answer 1, Authority 100%

you can. Describe the method you want to override in heir.

Previous articleFlipclock.js countdown
Next articleconvert int in enum

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions