[Zope-dev] Defining Interfaces

Martijn Pieters mj@zope.com
Tue, 29 Jan 2002 14:54:42 -0500


On Tue, Jan 29, 2002 at 07:47:46PM +0000, Florent Guillaume wrote:
> > > When I define an Interface, are the methods of the interface supposed to
> > > have "self" as the first argument?
> > 
> > No.
> 
> But this does preclude automatic validation of the "contract" using
> python inheritance from the Interface, doesn't it ? Or will there be
> another way ?

No, the validation methods take into account that class members of an
implementation will have a self-referential first argument. Detecting if an
implementation is a class is trivial.

-- 
Martijn Pieters
| Software Engineer  mailto:mj@zope.com
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------