On 3 Jan 2006 12:56:58 -0800 "Karsten W." <[EMAIL PROTECTED]> 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: Interface.verify.verify_class_implementation or Zope 3.x: zope.interface.verify 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 all). But I had the same problem you're having, and I found them useful. Cheers, Terry -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list