← VCE Software Development U3O1

Calling the parent __init__ with super()

Runs the parent class's __init__ first so it sets up inherited attributes, then the child's __init__ adds its own extra attributes.

Understanding Calling the parent __init__ with super() in VCE Software Development U3O1

What it does: The super().__init__(name) line runs the parent's setup, then self.wage = wage adds a child-only attribute. Because super() binds self automatically, passing self again sends an extra argument and causes a TypeError.

Common mistakes: The child __init__ must accept name so it can pass it up to the parent with super().__init__(name). Without the name parameter, name is undefined on the next line. It should be def __init__(self, name):. Car must list Vehicle in brackets to inherit from it. Without a parent class, super().__init__(brand) has no Vehicle setup to run. It should be class Car(Vehicle):.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 142–155) and word search (Modules 142–166).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which line inside Dog's __init__ runs the parent Animal's setup?
super().__init__(name)super.init(name)
Matches
def __init__(self, name, year): self.year = year super().__init__(name)
↓
The child sets its own attribute before calling the parent's __init__. Call super().__init__() first so the inherited setup runs before the child adds its own attributes.
Applying
Meanings
Term
super().__init__()
Meaning
Runs the parent class's __init__ first so it sets up inherited attributes, then the child's __init__ adds its own extra attributes.
Practice
class Student:
Testing
Gaps
super().(name)
Check Answer
Spots
1class Dog(Animal):
2 def __init__(self):

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Ostrich' badge — Full Sprint, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which line inside Dog's __init__ runs the parent Animal's setup?
A. super().__init__(name) ✓
B. super.init(name)
super().__init__(...) calls the parent's __init__ method. It needs the brackets after super and the double underscores around init.
2. A child class has its own __init__ and never calls super().__init__(). What happens to the parent's attributes?
A. They are not set up on the new object ✓
B. Python sets them up automatically
Defining __init__ in the child replaces the parent's __init__. Unless you call super().__init__(...), the parent's setup code never runs.
3. Parent: class Vehicle with __init__(self, make). Which child call passes the argument correctly?
A. super().__init__(self, make)
B. super().__init__(make) ✓
When you use super(), Python supplies self for you. Only pass the parent's other parameters, such as make.
4. Where should super().__init__(...) usually go in the child's __init__?
A. First, before the child-only attributes ✓
B. Last, after all the child-only attributes
Running the parent's setup first means the inherited attributes exist before the child adds its own extras.
5. Car's __init__(self, make, doors) calls super().__init__(make). Where does self.doors = doors belong?
A. In Vehicle's __init__, as it is shared
B. In Car's __init__, after the super() call ✓
doors is a child-only attribute. The child adds it in its own __init__, and the parent stays unchanged.

Match the Pairs

super().__init__(name, age) → Passes name and age up to the parent class's __init__ so it sets up the inherited attributes
super().describe() → Calls the parent class's version of an overridden method from inside the child class
A child class runs the parent's setup first, then adds an attribute that only the child has → def __init__(self, name, wage): super().__init__(name) self.wage = wage
A child class declares that it inherits from a parent class named Person → class Student(Person):
def __init__(self, name, year): self.year = year super().__init__(name) → The child sets its own attribute before calling the parent's __init__. Call super().__init__() first so the inherited setup runs before the child adds its own attributes.
super().__init__(self, name) → self is passed explicitly to super().__init__(). super() already supplies self, so it should be super().__init__(name).

Key Term

super().__init__()
Runs the parent class's __init__ first so it sets up inherited attributes, then the child's __init__ adds its own extra attributes.

Fill in the Blanks

1. super().__init__(name) self.breed = breed
Hint: Type the name of the special setup method of the parent that super() calls.
2. def describe(self): super().describe() print("Breed:", self.breed)
Hint: Type the built-in function that gives access to the parent class.
3. def describe(self, prefix): super().describe(prefix)
Hint: Type the parameter that is passed on to the parent method as its argument.
4. # child-only attribute self.team = team
Hint: Type the name of the extra attribute that only the child class adds.
5. def describe(self): super().describe() print("Breed:", self.breed)
Hint: Type the name of the overridden parent method that super() should call.

Spot the Error

Question 1
A class Dog(Animal):
B def __init__(self):
C super().__init__(name)
D self.tricks = []
Line B — The child __init__ must accept name so it can pass it up to the parent with super().__init__(name). Without the name parameter, name is undefined on the next line. It should be def __init__(self, name):
Question 2
A class Car:
B def __init__(self, brand):
C super().__init__(brand)
D self.doors = 4
Line A — Car must list Vehicle in brackets to inherit from it. Without a parent class, super().__init__(brand) has no Vehicle setup to run. It should be class Car(Vehicle):
Question 3
A class Person:
B def __init__(self, name)
C self.name = name
D class Staff(Person):
E def __init__(self, name):
F super().__init__(name)
Line B — A def line must end with a colon. Without it Python raises a SyntaxError and the parent setup never exists. It should be def __init__(self, name):
Question 4
A class Student(Person):
B def __init__(self, name, id):
C super.__init__(name)
D self.id = id
Line C — super needs brackets: super() gives access to the parent class. Writing super without () refers to the built-in type itself and fails. It should be super().__init__(name)
Question 5
A class Animal:
B def __init__(name):
C self.name = name
D class Fish(Animal):
E def __init__(self, name):
F super().__init__(name)
Line B — Every instance method, including __init__, must have self as its first parameter. Without self, the name argument is wrongly taken as the object. It should be def __init__(self, name):

Student with a class code? Join your class →