[Interface-dev] module-level interface

John Lenton jlenton at gmail.com
Wed Jun 8 11:12:26 EDT 2005


On 6/8/05, Jim Fulton <jim at zope.com> wrote:
> 
> Use the directlyProvides function (outside the class definition) or
> the classProvides function (inside the function) to declare interfaces
> provides by (as opposed to implemented by) the class.

oops, sorry about the misuse of terminology: what I mean is that the
modules and the classes must *implement* the interface. For example, a
skin module must provide a "Window" class that must implement the
IWindow interface. Currently I'm using
zope.interface.verify.verifyObject, and ISkin (the interface that must
be implemented by the module) looks like this:

class ISkin(interface.Interface):
    def Window():
        pass

with this, verifyObject checks that the skin provides the Window
class, but that's all; I'd like for it to check if the Window
implements IWindow. Is that doable? (I know I could do it "by hand"
using several verifies, but I thought I'd ask before doing
that---maintainability would suck)

-- 
John Lenton (jlenton at gmail.com) -- Random fortune:
Don't anthropomorphise computers and cars, They hate that.


More information about the Interface-dev mailing list