[Python-3000] pep 3124 plans

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jul 23 01:47:39 CEST 2007


Phillip J. Eby wrote:
> Well, if you're looking at *run-time*, then you can equally well dump 
> out the runtime contents of a generic function,

I'm not talking about doing this *at* run time. I'm
talking about reasoning about what the program will
do, based on your knowledge of what the run-time
type will be.

With a normal method call, you can take an assumed
run-time type, start at one end and follow things
through step by step. That's not so easy with
generic functions, for two reasons: (1) all of the
arguments can potentially influence where the
control flow goes, and (2) the overloading code
can be anywhere in the program, not confined to
the classes involved.

I'm not saying this makes GFs impossible to use,
but they do make the programmer's world considerably
more complicated. You can't just brush these concerns
off as being no worse than what OO already provides.

> I don't think that anybody's saying that unrestricted use of dynamism is 
> good, or that it can't be abused.  However, the potential for abuse is 
> no different.

I'm not talking about abuse. I'm only talking about using
GFs the way they're meant to be used. There's more to
think about in the presence of GFs even without any
abuse.

--
Greg



More information about the Python-3000 mailing list