[Python-3000] Discussions with no PEPs
Phillip J. Eby
pje at telecommunity.com
Tue Mar 13 02:46:27 CET 2007
At 06:06 PM 3/12/2007 -0700, Bill Janssen wrote:
>Phillip,
>
>I think there is a certain schizophrenia in Python between the older
>original procedural/functional orientation (itself somewhat split),
>and the newer-fangled (for Python) object style, between len(obj) and
>obj.len().
Where you see schizophrenia, I see a set of mostly very wise choices, actually.
>That's what makes it hard to evaluate the pros and cons
>between adding generic functions (as Lisp did, to support its own
>functional style), and adding interfaces (in whatever fashion) to
>support the object-oriented view of life.
And one of the benefits of Python is that it doesn't kowtow, Java-like to
an exclusively "object-oriented view of life". Life involves more than
objects, thank goodness. :)
Btw, I don't think the evaluation is difficult at all, and in any case it's
a false dichotomy. It's easy to implement interfaces and adaptation over
generic functions, but much harder to do the reverse. So if we have to
start somewhere, we might as well start with the more powerful feature
that's less prone to error and abuse.
In other words, if we must have interfaces, then let's steal more from
Haskell (typeclasses and instances defined in terms of generic functions)
and less from Java (ABCs and name-based abstract method collections). :)
More information about the Python-3000
mailing list