Python Programming: Lecture 4 Object Oriented Programming

Magic Methods I Non-traditional kind of polymorphism I e.g. we can use \+" on any type that implements __add__ I Generally, we shouldn’t check type, but just try to use the method we want I If the method is implemented, it gets executed, regardless of the object’s type I In some sense, the actual type doesn’t actually matter I Duck Typing: an object’s methods, rather than its type, ................
................