[Python-Dev] Re: PEP 246 and Protocols (Was: Sneaky 'super' instances)

Alex Martelli aleaxit@yahoo.com
Fri, 13 Jun 2003 11:11:58 +0200


On Thursday 12 June 2003 06:48 pm, Phillip J. Eby wrote:
   ...
> effectively said is, "well, let's make it so that case "e" is irrelevant,
> because there are plenty of __adapt__-capable protocols, and because you
> can register the relationships between them."  Thus, the solution to case
> "e" is effectively:
>
> Don't use built-in types as protocols!

Speaking as PEP 246's co-author and original champion of "case [e]", I think
you've hit the nail on the head.  Yes, singling out protocols as the "new kid
on the block" and giving each protocol the responsibility of handling the
registry of its adapters definitely strikes me as the right architecture, 
better than the vaguely defined one I had in mind (too vague to put in the
PEP) which as you say / imply elsewhere would necessarily end up with a
major case of chronical singletonitis.  I'm not sure about some other details
of PyProtocols (guess I need to study the whole package very, very
carefully) but this general architectural idea gets a wholehearted +1 from me.


Alex