[Python-Dev] defaultdict proposal round three

Delaney, Timothy (Tim) tdelaney at avaya.com
Tue Feb 21 03:10:21 CET 2006


"Martin v. Löwis" wrote:

> Delaney, Timothy (Tim) wrote:
>> However, *because* Python uses duck typing, I tend to feel that
>> subclasses in Python *should* be drop-in replacements. If it's not a
>> drop-in replacement, then it should probably not subclass, but just
>> use duck typing (probably by wrapping).
> 
> Inheritance is more about code reuse than about polymorphism.

Oh - it's definitely no hard-and-fast rule. owever, I have found that *usually* people (including myself) only subclass when they want an is-a relationship, whereas duck typing is behaves-like.

In any case, Guido has produced a patch, and the tone of his message sounded like a Pronouncement ...

Tim Delaney


More information about the Python-Dev mailing list