Python also supports duck typing—“if it walks like a duck and quacks like a duck, it is a duck”. In other words, if we want to call certain methods on an object, it doesn’t matter what class the object is, only that it has the methods we want to call.
- 6. Object-Oriented Programming
- from Programming in Python 3: A Complete Introduction to the Python Language, Second Edition
- Publisher: Addison-Wesley Professional
- Released: November 2009
so type doesn't matter, only interface matters. the dynamic of Python is intended for high efficient polymorphic programming, and use too many type annotations will ruin that ( why don't use Java instead? )
Share this highlighthttp://www.safaribooksonline.com/a/programming-in-python/9299456/