Homework Session07¶
The Art of Subclassing¶
The Art of Subclassing by Raymond Hettinger
http://pyvideo.org/video/879/the-art-of-subclassing
The most salient points from that video are as follows:
- Subclassing is not for Specialization
- Classes and subclassing are for code re-use – not creating taxonomies
- Bear in mind that the subclass is in charge
Stop Writing Classes¶
Stop Writing Classes by Jack Diederich
http://pyvideo.org/video/880/stop-writing-classes
“If your class has only two methods – and one of them is __init__
– you don’t need a class”
Python Class Toolkit¶
Python Class Toolkit by Raymond Hettinger
https://speakerdeck.com/pyconslides/pythons-class-development-toolkit-by-raymond-hettinger
Multiple Inheritance and the Diamond Problem¶
https://en.wikipedia.org/wiki/Multiple_inheritance
https://en.wikipedia.org/wiki/Multiple_inheritance#The_diamond_problem
Method Resolution Order
https://www.python.org/download/releases/2.3/mro/
http://python-history.blogspot.com/2010/06/method-resolution-order.html