[Python-3000] PEP 3100 Comments

Fredrik Lundh fredrik at pythonware.com
Mon May 8 15:06:28 CEST 2006


Thomas Wouters wrote:

> Duck typing isn't "ask the object whether it can do this". Duck typing is
> "do this". I don't believe 'taking different actions based on capabilities'
> is all that common, and it certainly breaks easily.

have you used callable(), or are you just making things up ?

> It may be 'common' for programmers to try and write this kind of code
> (accept either a string or an instance, a sequence or a single object, etc)
> but it's certainly not a common idiom -- idioms don't suck :-)

what widely used API:s have you designed, and what widely used API:s have you
studied when you decided that API:s that use callable to implement duck typing all
suck ?

(it actually works a lot better than some people here seem to think, which makes
me think that they've never used it.  generalizing from no examples at all isn't a great
way to design software...)

</F> 





More information about the Python-3000 mailing list