Jim,<br><br>Thanks for the quick reply and confirming that these side effects are unwanted.<br><br>I found a work around for my own code, but it would be great it these<br>things were eventually fixed in zope.interface.<br>
<br>Cheers,<br><br>Brian<br><br><div class="gmail_quote">On Fri, Oct 9, 2009 at 10:22 AM, Jim Fulton <span dir="ltr">&lt;<a href="mailto:jim@zope.com">jim@zope.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Fri, Oct 9, 2009 at 12:58 PM, Brian Granger &lt;<a href="http://ellisonbg.net" target="_blank">ellisonbg.net</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I am using zope.interface in a twisted based project.  I  have found two<br>
&gt; interrelated unwanted side effects of<br>
&gt; zope.interface.implements.  Here is a summary and self contained examples<br>
&gt; that show the problem:<br>
&gt;<br>
&gt; 1) The __provides__ attribute propagates * up* an inheritance tree to<br>
&gt; classes that know nothing of zope.interface.<br>
<br>
</div>Yeah. This is a consequence of the caching strategy.<br>
<div class="im"><br>
<br>
&gt; 2) The __provides__ attribute is a descriptor that will sometime raise an<br>
&gt; AttributeError even though it is listed in dir(cls).<br>
<br>
</div>Just because something&#39;s in a class __dict__ doesn&#39;t mean that it is<br>
accessible via getattr.  A descriptor can and often will raise an<br>
attribute error.<br>
<div class="im"><br>
<br>
&gt; This means that things<br>
&gt; like inspect.getmembers doesn&#39;t work.<br>
<br>
</div>Yeah. Inspect is broken. (I really should fix that.)<br>
<div class="im"><br>
&gt;  Because __provides__ propagates *up*<br>
&gt; an inheritance tree, inspect.getmember has stopped working on all of my<br>
&gt; classes even though they are plain old objects.<br>
<br>
</div>Yeah, that&#39;s pretty lame.<br>
<br>
We really need to change the strategy for managing declarations.<br>
<br>
Jim<br>
<br>
--<br>
<font color="#888888">Jim Fulton<br>
</font></blockquote></div><br>