[Python-3000] Discussions with no PEPs

Phillip J. Eby pje at telecommunity.com
Mon Mar 12 20:33:14 CET 2007


At 02:14 PM 3/12/2007 -0400, Barry Warsaw wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On Mar 11, 2007, at 7:50 AM, Benji York wrote:
>
> > Greg Ewing wrote:
> >> Barry Warsaw wrote:
> >>> We already have an established, community accepted implementation
> >>> of  interfaces,
> >> Really? Which one is that?
> >
> > I believe Barry was referring to zope.interface.
>
>Correct.  AFAIK, there is only one other competing, mature package
>(but please correct me if I'm wrong!): PyProtocols.  My impression is
>that the latter is essentially a superset of the former and that the
>latter is compatible with the former.
>
>The question then becomes whether we really want to invent a third
>way of doing interfaces in Python, or whether our time is better
>spent selecting and promoting one of the existing, tried-and-true
>packages.  Perhaps it would be better for us to figure out how and if
>the two packages can be integrated.  If a third way is still
>advocated, then I think it must have a fairly high barrier to
>acceptance in order to push aside such long accepted libraries.

Personally I think both packages are overkill for the language and/or 
stdlib, if only because they're solutions for the wrong problem.  (Note 
that PEPs 245 and 246 were rejected for related reasons.)

For maybe 80-90% of the purposes that I originally created PyProtocols for, 
I have found that "simplegeneric" ( 
http://cheeseshop.python.org/simplegeneric/ ) is more than adequate -- and 
it's only 80 lines of code.  Guido's more featureful GF prototype isn't 
that much bigger, I don't believe - heck, it might be smaller if memory serves.

Of course, generic functions require you to say 'foo(bar)' instead of 
'bar.foo()' (and IIUC, that's the big sticking point for Guido wrt to GF's 
in Py3K).

But then again, interfaces and adapters require you to say 
'IFoo(bar).foo()' also, so that's not really an improvement.



More information about the Python-3000 mailing list