[Python-3000] Abilities / Interfaces
Andrew Koenig
ark-mlist at att.net
Tue Nov 21 23:42:32 CET 2006
> In fact I'd be disappointed if some good deep
> thinking about the ontology of interfaces wouldn't lead us to some
> welcome changes to the specs.
I don't know where this idea falls on the continuum between deep and silly,
but...
Suppose we stick for the moment with the notion that types (and objects of
those types) can have abilities, and that those abilities are represented by
other objects. So an object of type Foo might have ability Bar, and we
would like to have some way of testing whether Foo has that ability. In
other words, we would like a way to determine whether the author of Foo
claims that Foo has ability Bar.
Nothing new so far. But it just occurred to me that part of an ability
(i.e. one of the methods of an ability) might be code that performs
compliance tests on an object that claims to have that ability. This idea
is very sketchy, but it suggests that perhaps abilities could be parking
places for generic unit tests for interfaces, rather than tests of specific
types or pieces of code.
More information about the Python-3000
mailing list