tuples, index method, Python's design

Carsten Haese carsten at uniqsys.com
Thu Apr 12 10:37:55 EDT 2007


On Thu, 2007-04-12 at 14:10 +0000, Antoon Pardon wrote:
> People are always defending duck-typing in this news group and now python
> has chosen to choose the option that makes duck-typing more difficult.

Au contraire! The "inconsistent" behavior of "in" is precisely what
duck-typing is all about: Making the operator behave in a way that makes
sense in its context. Nobody seems to be complaining about "+" behaving
"inconsistently" depending on whether you're adding numbers or
sequences.

-Carsten





More information about the Python-list mailing list