<br><br><div class="gmail_quote">On 9 April 2012 15:41, Brian Sutherland <span dir="ltr">&lt;<a href="mailto:brian@vanguardistas.net">brian@vanguardistas.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5">On Sun, Apr 08, 2012 at 01:04:37PM -0700, Ross Patterson wrote:<br>
&gt; experimental.broken is working well for me.  It greatly aided me in<br>
&gt; getting through a particularly nasty upgrade allowing me to cleanup the<br>
&gt; ZCA cruft left by poorly behaved add-ons.  I&#39;d like to proceed with<br>
&gt; adding the core of this to zope.interface and I need the<br>
&gt; developers/maintainers to weigh in.<br>
&gt;<br>
&gt; The first and most fundamental matter is changing interface pickles such<br>
&gt; that they can be unpickled into something that can fulfill the minimum<br>
&gt; interface contract and don&#39;t break the ZCA.  To that end, I&#39;d like to<br>
&gt; add the following to zope.interface.interface:<br>
&gt;<br>
&gt;     ...<br>
&gt;     try:<br>
&gt;         from ZODB.broken import find_global<br>
&gt;         from ZODB.broken import IBroken<br>
&gt;         def find_interface(modulename, globalname,<br>
&gt;                            Broken=IBroken, type=InterfaceClass):<br>
&gt;             &quot;&quot;&quot;<br>
&gt;             Find a global interface, returning a broken interface if it can&#39;t be found.<br>
&gt;             &quot;&quot;&quot;<br>
&gt;             return find_global(modulename, globalname,<br>
&gt;                                Broken=IBroken, type=InterfaceClass)<br>
&gt;     except ImportError:<br>
&gt;         IBroken = Interface<br>
&gt;         def find_interface(modulename, globalname,<br>
&gt;                            Broken=IBroken, type=InterfaceClass):<br>
&gt;             &quot;&quot;&quot;<br>
&gt;             Find a global interface, raising ImportError if it can&#39;t be found.<br>
&gt;             &quot;&quot;&quot;<br>
&gt;             # From pickle.Unpickler.find_class<br>
&gt;             __import__(module)<br>
&gt;             mod = sys.modules[module]<br>
&gt;             klass = getattr(mod, name)<br>
&gt;             return klass<br>
&gt;     ...<br>
&gt;     class InterfaceClass(Element, InterfaceBase, Specification):<br>
&gt;     ...<br>
&gt;         def __reduce__(self):<br>
&gt;             if self is IBroken:<br>
&gt;                 return self.__name__<br>
&gt;             return (find_interface, (modulename, globalname))<br>
&gt;     ...<br>
<br>
</div></div>-1<br>
<br>
For a number of reasons, but mainly because you add a test dependency on<br>
the ZODB from zope.interface. I think that zope.interface is such a<br>
fundamental package and the dependency is unacceptable.<br></blockquote><div><br></div><div>It&#39;s a soft dependency only, looking at the code sample.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


There has lately been a LOT of work done reducing the dependency<br>
structure of zope.* packages. You need a VERY good reason to start<br>
reversing that.</blockquote><div><br></div><div> It doesn&#39;t add any more (required) dependencies.</div><div><br></div><div>This is a real issue that is breaking the sites of a lot of real users of zope.interface in a way that is hard to debug and reverse.</div>

<div><br></div><div>Can you think of a better way to get around it? Other than &quot;don&#39;t get into the situation&quot; which isn&#39;t a valid answer as long as the ZTK ecosystem supports persistent local components.</div>

<div><br></div><div>Martin</div></div>