An abstract class defines shared structure or behavior for related classes without being instantiated directly. It helps keep common code in one place instead of repeating it across each child class. section 4.1.3
class ParentClass:
pass
class ChildClass(ParentClass):
pass
A parent class can hold common characteristics while child classes inherit and extend them. section 4.1.3
A practical shape hierarchy starts with shared behavior in Shape, then specializes it through Rectangle and Circle. Rectangle can reuse inherited position and color data while providing its own drawing behavior; Circle can adapt inherited dimensions and override drawing for circular geometry. section 4.1.3
Use an abstract class when related classes should share a foundation but still provide their own details:
- Centralize repeated attributes and behavior in the parent class. section 4.1.3
- Let child classes add unique attributes or modify inherited behavior. section 4.1.3
- Call inherited initialization with super() when constructing specialized objects. section 4.1.3





