[Python-3000] iostack and Oh Oh

Bill Janssen janssen at parc.com
Thu Nov 30 22:47:25 CET 2006


> so no offense in advance.

Sure, no offense taken.  I've seen comments like this before on this
list (recently :-).  I think both approaches (interface types and duck
typing) are complicated in different ways.  But interface types seem
less so, because they provide a place where the user can stop thinking
about what's behind a function or method, instead of having to
understand the code "all the way down".  And it doesn't preclude the
use of "just implement the method" for code that you understand "all
the way down" already, where you know that the only use of a
particular value is to call the "foo" method on it.  But it also
ensures that when someone gets a Mapping, they can call "values" on it
(to list one mis-example of partial implementation that I've tripped
over in the past).

Bill


More information about the Python-3000 mailing list