Skip to main content

Practice · 1 of 3

Mixin that must come first

CHALLENGE
Difficulty: advanced+25 XP

You are given a base Base with label() returning 'base'. Build a class Widget from mixins and Base such that Widget().label() returns 'widget+base': - LabelMixin overrides label() to return 'widget+' + super().label() - the class statement must be class Widget(<one or more mixins>, Base) — the mixin must run BEFORE Base's method - also return the MRO class names (excluding object) from mro_names() as a list

Back to lesson: Practice: MRO & Mixin Practice