Hash: SHA1

Martin Aspeli wrote:
> Tres Seaver wrote:
>> - - The branch kills off both the use of 'zope.deferredimport' and the
>>   'bbb' subpackage, leaving something which could be used in Jython, or
>>   IronPython, or the GAE.
> Why is zope.deferredimport a problem? Does it do something CPython 
> specific? As a small utility, I don't think it's a particualrly 
> troublesome dependency.

Have you looked at what zope.deferredimport actually does?  It uses
zope.proxy to create wrappers around objects in sys.modules!  There is
effectively no way that any Python developer who hasn't already drunk
the Zope Koolaid will ever willingly put up with such a
grotexque^Wingenious hack.  The only way it can do that is via a C
modlue (in zope.proxy), because CPython won't tolerate "duck typing" of
module objects, which makes it a deal-killer for the non-CPython
platforms, too.

I thought originally that the dependency was there to support emitting
deprecation warnings, but not so:  essentially, the deferreed imports
were there to paper over import cycles.  Ripping it out meant making the
inter-module dependencies *within* zope.component explicit and sane,
which was a net win, too, even without losing the C extension.  Note
that I also had to switch to "from imports", because the other style is
the actual source of the cycles (e.g., using the '@component.adapter'
decorator at module scope).

The transitive dependencies in the released zope.component (not counting
testing dependencies) are:

 - zope.interface
 - zope.event
 - zope.deprecation
 - zope.deferredimport
 - zope.proxy

On my branch, the transitive dependencies (again, not counting tests) are:

 - zope.interface
 - zope.event

which feels a lot saner to me:  zope.interface is obviously required for
anybody using zope.component, and zope.event is tiny, unchanging, and
pure Python (I *am* dubious of the real-world utility of the events it
actually emits, but that is another story).  I think that minimizing
non-essential dependencies is crucial to getting wider use of the
packages, especially outside the purple-lipped crew here in the compound. :)

- --
Tres Seaver          +1 540-429-0999          tsea...@palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to