Hi,<br><br>I know this is not the zope list, but I am encountering this in a twisted project, so I <br>wanted to get some ideas here first.  I am finding that zope.interface is like<br>an infectious disease.  Here is a simple example:<br>
<br>In [35]: import zope.interface as zi<br><br>In [37]: class A(object):<br>   ....:         pass<br><br>In [38]: class IB(zi.Interface):<br>   ....:         pass<br><br>In [39]: hasattr(A, &#39;__provides__&#39;)<br>Out[39]: False<br>
<br>In [41]: # Inheriting from A gives A additional methods<br><br>In [42]: class B(A):<br>   ....:         zi.implements(IB)<br><br>In [43]: hasattr(A, &#39;__provides__&#39;)<br>Out[43]: True<br><br>In [45]: # C is clean of the additional methods<br>
<br>In [46]: class C(object):<br>   ....:         pass<br><br>In [47]: hasattr(C, &#39;__provides__&#39;)<br>Out[47]: False<br><br>The disturbing thing is that now A (which is just an object) has been hacked on<br>by zope.interface.  It has additional methods (__provides__, etc.) that are specific to<br>
zope.  <br><br>Summary: If a class A is later subclassed by something B that calls zi.implements, the original class A<br>becomes infected with all the zope.interface stuff.<br><br>Is there a way to avoid this?  Doesn&#39;t this seem like a bad idea?<br>
<br>Cheers,<br><br>Brian<br>