12.9 Summary
In this chapter we learned about inheritance, the ability to design and implement classes that take advantage of natural relationships existing between them. These relationships provide a way for us to organize our classes. Superclasses contain general details (instance variables and methods) that pertain to an object. Subclasses contain details that allow objects to be more specific. This parent–child relationship, called an IS-A relationship, allows child objects to have all the functionality of parent objects while adding specific additional details. Another relationship called HAS-A exists when an object of one class is an instance variable of another class. This relationship is also called composition.
Key Terms
abstract ...
Get Python Programming in Context, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.