[Python-3000] Abilities / Interfaces
rrr at ronadam.com
Tue Nov 21 22:56:03 CET 2006
Guido van Rossum wrote:
> On 11/20/06, Guido van Rossum <guido at python.org> wrote:
>> I'd like to have a discussion of abilities and interfaces but right
>> now I don't have time -- maybe tomorrow. I see Andrew's proposal as
>> mostly isomorphic to Zope's notion of interfaces, but the new
>> terminology may make it possible to clarify certain distinctions
>> better, e.g. the distinction between a class that provides an ability
>> to its instances, and the abilities that an instance has.
>> Feel free to riff on this theme here. I'll check in within 24 hours or so.
> OK, I have some more time for this now. I'm hoping Andrew, Bill and
> Phillip will join the discussion here (instead of various other
> I'd like to explore this some more before committing to anything.
Here's a thought:
For identifying abilities, it almost seems like instead of hard coding a library
of this is that relationships, which will always be incomplete and possibly easy
to fool, an ability might be described as a small (minimal) test that a
interface can pass. Registering an ability relationship could require running
it against an ability test prior to use.
It doesn't have to be done just prior to use. It could be done at import time,
or even earlier with the result restored at application run time so it can be a
one time cost for most applications.
This may make it more open ended and add a level of actual testing that may be
useful for debugging as well.
More information about the Python-3000