A superclass is a parent or base class whose attributes and behavior are inherited by a child, also called a subclass. Inheritance keeps shared functionality in one place, supporting the DRY principle while allowing specialized classes to add or modify behavior. section 4.1.3
Shapes and specialized behavior
A Shape superclass can hold shared position, color, size, and movement behavior. Rectangle inherits from Shape and draws a rectangle; Square inherits from Rectangle and passes equal dimensions to the parent initializer; Circle inherits from Shape and replaces drawing behavior for circular geometry. section 4.1.3
class ParentClass:
pass
class ChildClass(ParentClass):
pass
Shows the minimal Python syntax for declaring a parent class and inheriting from it. section 4.1.3









