Code Nexus
CurriculumHow we teachPricingBlogAboutContact
Start learning
  1. Curriculum
  2. /
  3. Season 2
  4. /
  5. Episode 6

Season 2: The Python Team · Episode 6 of 8

The Inheritance Plot Twist

You play: AI Engineering Trainee

Free
Start this episode free

Episodes run on a tablet or larger screen.

The situation

Livestream creators need extra reporting fields on top of the standard creator report. A rushed LiveCreatorReport subclass copied the whole parent method, added two lines, and quietly broke the standard report for everyone else.

What you'll learn

  • PCAP 4.4-4.5: introspection (isinstance / issubclass / hasattr), inheritance, method overriding, polymorphism, `super()`, and choosing inheritance vs composition.
  • Multiple inheritance and the MRO, super() as the next class in the MRO, __name__, __module__ and __bases__, isinstance and issubclass, and duck-typed polymorphism.

Who you work with

  • Maya Chen

    Senior AI Engineer · Your mentor

  • Amara Okafor

    ML and Data Engineer

Scenes

  1. 1.It worked yesterday
  2. 2.Predict the override
  3. 3.The diamond
  4. 4.Extend, don't fork
  5. 5.Inheritance or composition?
  6. 6.Inheritance check

What you leave with

LiveReport reuses the base summary through super and appends its extra field. ScheduledReport holds a compatible report and delegates to summary instead of inheriting its interface. Keep tests for both behaviours when the base changes.

Previous episode

Meet the Creator Object

Next episode

The Export That Ate Memory

Code Nexus

Practice first. Improvise less later.

We post practical tech tips and the odd 8-BIT opinion. Mostly the tips.

The CPD Group Approved Provider #791172

Learn

  • Curriculum
  • Pricing
  • Create account
  • Sign in

Support

  • Blog
  • Certification guides
  • About Code Nexus
  • How we teach
  • Human help

Legal

  • Terms and Conditions
  • Privacy Policy
  • Cookie Policy
  • Refund and Cancellation
  • Contact: contact@codenexus.co.za

© 2026 Code Nexus. All rights reserved.

Payments secured by Payfast · Billed in ZAR · South Africa