[Zope-dev] Defining Interfaces

Steve Alexander steve@cat-box.net
Sun, 27 Jan 2002 22:09:53 +0000


Jeffrey P Shell wrote:
> On 1/27/02 11:25 AM, "Steve Alexander" <steve@cat-box.net> wrote:
> 
> 
>>Hi folks,
>>
>>When I define an Interface, are the methods of the interface supposed to
>>have "self" as the first argument?
>>
> 
> No.

In which case, perhaps we should change InterfaceInterface and 
InterfaceBaseInterface from Interface/iclass.py to reflect this.

The ZDG should also be updated to reflect this, as the example is wrong.

   http://www.zope.org/Documentation/ZDG/ComponentsAndInterfaces.stx

  from Interface import Base

       class Hello(Base):
           """ The Hello interface provides greetings. """

           def hello(self, name):
               """ Say hello to the name """

       class HelloComponent:

           __implements__ = Hello

           def hello(self, name):
               return "hello %s!" % name


Shall I throw this into the Collector?

--
Steve Alexander