<div>Hi,</div>
<div> </div>
<div>I believe not. In any case, implements, provides and such things are more like indications of what is being supported by a class and they are not enforced by runtime strictly. </div>
<div> </div>
<div>I just tried following:</div>
<div> </div>
<div>#####################################################################</div>
<div>
<p>from zope.component import *<br>from zope.interface import *<br>from zope.interface.verify import *</p>
<p>class IA(Interface): pass</p>
<p>class IB(IA): pass</p>
<p> </p>
<p><br>class B(object):<br> implements(IB)</p>
<p><br>verifyClass(IA, B) #returns True<br>verifyClass(IB, B) #returns True<br>verifyClass(Interface, B) #returns True</p>
<p> </p>
<p>class IC(Interface) : pass</p><br>
<div>#####################################################################</div><br> </div>
<div>Its usually a good idea to setup unit tests for testing these kind of things. </div>
<div> </div>
<div>With regards,</div>
<div>- Shailesh</div>
<div> </div>
<div><span class="gmail_quote">On 7/15/08, <b class="gmail_sendername">Tim Cook</b> <<a href="mailto:timothywayne.cook@gmail.com">timothywayne.cook@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">If interface B inherits from interface A and class B implements<br>interface B; do I need to explicitly state that class B provides<br>
interface A?<br><br>Concrete example:<br><br>class IElement(Interface):<br> value = Object(<br> schema=IDataValue,<br> title=_(u"value"),<br> description=_(u"""Data value of this leaf."""),<br>
required=False<br> )<br><br>class IDvText(IDataValue):<br><br>...<br><br><br>class DvText(DataValue):<br><br>....<br><br>implements(IDvText)<br>classProvides(IDvText)<br><br><br>Will Element.value allow instances of DvText or do I need to change the<br>
DvText classProvides call to:<br><br>classProvides(IDataValue,IDvText)<br><br>Thanks,<br>Tim<br><br><br><br><br><br>--<br>Timothy Cook, MSc<br>Health Informatics Research & Development Services<br>LinkedIn Profile:<a href="http://www.linkedin.com/in/timothywaynecook">http://www.linkedin.com/in/timothywaynecook</a><br>
Skype ID == timothy.cook<br>**************************************************************<br>*You may get my Public GPG key from popular keyservers or *<br>*from this link <a href="http://timothywayne.cook.googlepages.com/home*">http://timothywayne.cook.googlepages.com/home*</a><br>
**************************************************************<br><br>_______________________________________________<br>Zope3-users mailing list<br><a href="mailto:Zope3-users@zope.org">Zope3-users@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope3-users">http://mail.zope.org/mailman/listinfo/zope3-users</a><br>
<br><br></blockquote></div><br>