Re: [Python-Dev] defaultdict proposal round three
21 Feb
2006
21 Feb
'06
3:10 a.m.
"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
6659
Age (days ago)
6659
Last active (days ago)
0 comments
1 participants
participants (1)
-
Delaney, Timothy (Tim)