[Zope-dev] SVN: zope.component/branches/tseaver-wo_zope_deferred/

Tres Seaver tseaver at palladion.com
Tue Mar 3 22:45:51 EST 2009


-----BEGIN PGP SIGNED MESSAGE-----
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.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJrflv+gerLs4ltQ4RAnylAJ0f/uulXowSBdulTT0kO+bUzIXwWwCgoSyi
a6M2GtcQN/qKag/bYammkmI=
=iE1H
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list