A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-February/061547.html below:

[Python-Dev] defaultdict proposal round three

[Python-Dev] defaultdict proposal round three [Python-Dev] defaultdict proposal round threeDelaney, Timothy (Tim) tdelaney at avaya.com
Tue Feb 21 01:19:24 CET 2006
Greg Ewing wrote:

> In other words, just because A inherits from B in
> Python isn't meant to imply that an A is a drop-in
> replacement for a B.

Hmm - this is interesting. I'm not arguing Liskov violations or anything
...

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).

Subclassing implies a stronger relationship to me. Which is why I think
I prefer using a wrapper for a default dict, rather than a subclass.

Tim Delaney
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4