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"><<a href="mailto:jim@zope.com">jim@zope.com</a>></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 <<a href="http://ellisonbg.net" target="_blank">ellisonbg.net</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I am using zope.interface in a twisted based project. I have found two<br>
> interrelated unwanted side effects of<br>
> zope.interface.implements. Here is a summary and self contained examples<br>
> that show the problem:<br>
><br>
> 1) The __provides__ attribute propagates * up* an inheritance tree to<br>
> 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>
> 2) The __provides__ attribute is a descriptor that will sometime raise an<br>
> AttributeError even though it is listed in dir(cls).<br>
<br>
</div>Just because something's in a class __dict__ doesn'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>
> This means that things<br>
> like inspect.getmembers doesn't work.<br>
<br>
</div>Yeah. Inspect is broken. (I really should fix that.)<br>
<div class="im"><br>
> Because __provides__ propagates *up*<br>
> an inheritance tree, inspect.getmember has stopped working on all of my<br>
> classes even though they are plain old objects.<br>
<br>
</div>Yeah, that'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>