Greg Ewing wrote: >Delaney, Timothy (Tim) wrote: > > > >>However, *because* Python uses duck typing, I tend to feel that >>subclasses in Python *should* be drop-in replacements. >> >> > >Duck-typing means that the only reliable way to >assess whether two types are sufficiently compatible >for some purpose is to consult the documentation -- >you can't just look at the base class list. > > > What's the API for that ?
I've had problems in code that needs to treat strings, lists and dictionaries differently (assigning values to a container where all three need different handling) and telling the difference but allowing duck typing is *problematic*. Slightly-off-topic'ly-yours, Michael Foord _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com