[Python-3000] PEP 3124 - Overloading, Generic Functions, Interfaces, etc.

Greg Ewing greg.ewing at canterbury.ac.nz
Wed May 2 09:48:23 CEST 2007

Phillip J. Eby wrote:

> Yep, that was my theory too, until I actually used generic functions.

Is there something about generic functions that makes
them different from methods in this regard? I've used
OO systems which have the equivalent of @before, @after
etc. for overriding methods, and others (including
Python) which don't, and I've never found myself missing
them. So I'm skeptical that they're a must-have feature
for generic functions.

> 1) a lot more pleasant not to write the extra boilerplate all the time,

I'd work on that by finding ways to reduce the boilerplate.
Calling the next method of a generic function shouldn't
be any harder than calling the inherited implementation
of a normal method.

> By the way, if you look at the PEP, you'll find motivating examples for 
> each of the decorators,

There are examples, yes, but they don't come across as
very compelling as to why there should be so many variations
of the overloading decorator rather than a single general

> IIRC, CLOS has about *8 more* kinds of method combinators

CLOS strikes me as being the union of all Lisp dialects that
anyone has ever used, rather than something with a coherent
design behind it. So quoting CLOS is not going to make me
think better of anything.


More information about the Python-3000 mailing list