<< Chapter < Page | Chapter >> Page > |
This module is one in a collection of modules on Python designed for teaching ITSE 1359 Introduction to Scripting Languages: Python at Austin Community College in Austin, TX.
Earlier modules provided
You will learn a little about Python class inheritance in this module.
I recommend that you open another copy of this module in a separate browser window and use the following links to easily find and view the Figuresand the Listings while you are reading about them.
(Note to blind and visually impaired students: most of the Figures and all of the Listings inthis module are presented in plain text format and should be accessible using an audio screen reader or a braille display. Note however that the requiredindentation may not be properly represented by an audio screen reader.)
I told you in an earlier module that OOP is an abbreviation for Object-Oriented Programming. I told you that most books on OOP will tell youthat in order to understand OOP, you need to understand the following three concepts :
I have discussed encapsulation in some detail in previous modules. As near as I can tell, unlike C++ and Java, Python does not support polymorphism, at leastnot in any significant way.
C++ and Java support two forms of polymorphism:
Both of these depend on the "strongly-typed" nature of C++ and Java. Runtime polymorphism using virtual functions and base-class pointersalso depends on inheritance.
Because Python is a "weakly-typed" (if typed at all) programming language, I don't know how to implement either form of polymorphism using Python. (However, if I am wrong on this, I will be happy to learn how to implement polymorphism in Python.)
Notification Switch
Would you like to follow the 'Itse 1359 introduction to scripting languages: python' conversation and receive update notifications?