[Python-3000] Abilities / Interfaces

Phillip J. Eby pje at telecommunity.com
Tue Nov 21 23:59:40 CET 2006


At 05:25 PM 11/21/2006 -0500, Fred L. Drake, Jr. wrote:
>On Tuesday 21 November 2006 17:18, George Sakkis wrote:
>  > I'd like that too, with some concrete examples if possible.  I'm still
>  > unsure what interfaces buy us that ABCs (are these the same/equivalent
>  > to mixins?) don't, especially with an adaptation/generic function
>  > mechanism in place.
>
>One thing that mixins/ABCs can't support that we use quite frequently in Zope
>3 applications is stamping additional interfaces on instances.  This is often
>done to influence adaptation.

I was under the impression that Zope's actual use cases for 
instance-specific interfaces have mainly to do with *view* lookups and 
other types of lookups that don't really come into the current discussion 
scope as I understand it.  That is, I thought that instance interfaces were 
used primarily for "n-tuple adaptation" (the adaptation equivalent of 
multiple and/or predicate dispatch)?

If that's the case, then ISTM that as long as we make the core mechanism 
extensible, Zope's use cases should be handle-able.  I certainly wouldn't 
be in favor of a proposal that would marginalize Zope's paradigm, any more 
than I'd be in favor of one that blessed it.  :)  I just want a minimal 
core that blesses what the language and stdlib *already* do (special 
methods and single-dispatch __mro__ lookups), while still allowing 
"advanced" paradigms (Zope, RuleDispatch, etc.) to "play on a level playing 
field" with each other.



More information about the Python-3000 mailing list