python:about_python:about_python_iv
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
python:about_python:about_python_iv [2013/07/05 06:19] – created mithat | python:about_python:about_python_iv [2019/06/21 23:09] (current) – [Inheritance in Python] mithat | ||
---|---|---|---|
Line 33: | Line 33: | ||
One of the advantages of implementing classes with inheritance is **code reuse**. | One of the advantages of implementing classes with inheritance is **code reuse**. | ||
- | Since you do not need to rewrite the code that is common to both base and derived classes, you end up writing less code. But even more important, when you fix a bug in the base class, it automatically propagates | + | Since you do not need to rewrite the code that is common to both base and derived classes, you end up writing less code. But even more important, when you fix a bug in the base class, it automatically propagates to the derived classes. |
=== Inheritance and polymorphism === | === Inheritance and polymorphism === | ||
Line 43: | Line 43: | ||
To demonstrate the use of inheritance in Python, we are going to create a specialized version of '' | To demonstrate the use of inheritance in Python, we are going to create a specialized version of '' | ||
- | <img src=" | + | {{: |
In addtion to the two buttons found on a '' | In addtion to the two buttons found on a '' |
python/about_python/about_python_iv.1373005193.txt.gz · Last modified: 2013/07/05 06:19 by mithat