[Python-3000] Sane transitive adaptation

Guido van Rossum guido at python.org
Thu Apr 6 23:15:10 CEST 2006


On 4/6/06, Phillip J. Eby <pje at telecommunity.com> wrote:
> I don't want to discourage people from working out their own ideas,
> but a lot of the stuff that's being discussed here about protocol
> adaptation is already implemented in PyProtocols.

That's great. I believe that if we derive things from first principles
here and arrive at the same choices as PyProtocols, we haven't wasted
anybody's time; rather, we've (a) educated everyone who participated a
whole lot on how to build a good dynamic function overloading package;
(b) validated the choices you made in PyProtocols; (c) explained a lot
of the warts in PyProtocols. That to me seems an invaluable
contribution, and I expect it's easier to do it this way than to try
and understand PyProtocols by attempting to understand its code and
docs.

Lots of people learn by doing rather than by seeing. I'm one of them.
For example, I still owe you an update to the examples in PEP 342. One
reason I haven't done this is that after starting from first
principles, after a few days I arrived at something very similar to
your trampoline example. For me, the *only* way to understand the
ready-made trampoline code that you aput in the PEP was to try to
create a similar thing from scratch, and evolve it until it had the
same functionality. I still have the 3 or 4 evolutionary steps I made
in a directory on an old laptop. Without the first few steps I wasn't
able to understand the rationale behind the design of the completed
example. I expect that many others have the same problem with that
example. (Hands please; who here understands example 3 in PEP 342?)

At the moment I'm doing the same for overloadable functions. However,
instead of doing it in the privacy of a hotel room in a temp directory
on a disconnected laptop, I'll blog about it. There'll be a lot of
thinking aloud, a couple of dead alleys and red herrings, and every
once in a while I'll have to buy a clue from PyProtocols. But I really
see no other way to do it; when I look at the completed PyProtocols my
eyes just start glazing over.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list