Interfaces (a la PEP 245 and Zope)

Brendan Hahn bhahn at spam-spam.g0-away.com
Fri Aug 1 16:35:19 EDT 2003


Terry Hancock <hancock at anansispaceworks.com> wrote:
>Brendan Hahn wrote:
>> How about an Interface metaclass that replaces any class methods with an
>> appropriate exception-raiser.  
 [...]
>Well Zope's (or should I say Jim Fulton's?) Interface module
>defines an object with a number of useful documentation and
>validation behaviors.

I haven't checked out the Zope stuff...that just popped into my head as a
slightly easier way to implement Heiko's suggestion.  You could use it as a
way to generate base classes that enforce the required-implementation
aspect of interfaces (maybe call it 'Abstract') and also inherit from other
sources to provide validation and such.

-- 
brendan DOT hahn AT hp DOT com




More information about the Python-list mailing list