check if class really implements api?

Terry Hancock hancock at
Wed Jan 4 07:25:46 CET 2006

On 3 Jan 2006 12:56:58 -0800
"Karsten W." <DonQuixoteVonLaMancha at> wrote:
> with the zope.interface module I can query if my class
> claims to implement my API. This
> is what the method implementedBy is for.
> However, I find myself constantly changing the API and I
> am looking for a more reliable way
> to check my implementation classes. Is there a way to
> check if at least all function
> names of the API are defined by the class and if their
> parameter lists fit the API? A way
> to test this would save me a lot of time..

You want:

Zope 2.5.1:


Zope 3.x:

You'll want to read the source modules for documentation and
usage, as I don't think these are particularly well
documented anywhere else.

They are somewhat different in API between the two interface
implementations, but both do essentially the same thing --
they check the class against the interface object.  This
will only tell you whether the methods are there and have
the same calling profile -- it obviously can't tell you
whether they do what you expect (or indeed do anything at

But I had the same problem you're having, and I found them


Terry Hancock (hancock at
Anansi Spaceworks

More information about the Python-list mailing list