Reading the (very useful) article: Typing: Strong vs. Weak, Static vs. Dynamic has lead me to re-formulate my understanding of name-based polymorphism.
Simply put, Python has what is sometimes referred to as 'duck typing'. That is, if an object has the attributes one associated with a duck, then its a duck, *regardless* of its inheritance hierarchy.
In Aspect Oriented Programming-speak, it is as if Python "interfaces" (Java speak) are implemented as cross-cutting concerns rather than tucked into the syntax of the language.
In philosophy-of-language-speak, it is as if Python does not require a rigid designator for a collection of object attributes.
i.e. You don't have to name the interface. Any collection of attributes is readily usable as an interface - no formal naming mechanism required
Descriptivists probably approve:-)
No comments:
Post a Comment