[Zope3-Users] IContentType: interface implements another
interface ?
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu May 26 08:33:56 EDT 2005
On Thursday 26 May 2005 03:31, Leeuw van der, Tim wrote:
> In java-terms you'd say that one interface *extends* another interface,
> rather than implements. But I guess this wording is because Python doesn't
> have interfaces, and therefore in your class-definition you might not see
> the difference?
I don't think *extends* is correct. An example:
class I1(Interface):
pass
class I2(I1):
pass
In the case above ``I2`` extends ``I1``. ``I2`` inherits all fields and method
declarations from ``I1``.
But providing is different, since it does:
class I1(IInterface):
pass
class I2(Interface):
pass
directlyProvides(I2, I1)
Here ``I1`` is provided by ``I2``, in other words ``I2`` must provide all the
methods and fields described in ``I1``. Also note that ``I1`` extends
``IInterface`` and not ``Interface``!
Regards,
Stephan
--
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
More information about the Zope3-users
mailing list