[Zope-dev] Optional C extensions

Jim Fulton jim at zope.com
Wed Mar 10 18:46:06 EST 2010


On Wed, Mar 10, 2010 at 7:17 AM, Tim Hoffman <zutesmog at gmail.com> wrote:
...
> Unfortunately I needed deferredimport and was completely unsure how
> else to proceed at the time.
> I use code generation for gae based models, and the unfortunately
> reference entities need actual models/classes which means you can very
> easily create
> cyclic dependancies.  Storm allows references to be defined "strings"
> such as "model.MyClass"  but gae doesn't implement such a thing,
> so deferredimport was the next best thing.

I thought about this a bit and realized that I could implement
deferred import without using proxies. I don't know why I didn't think
of this before.

Then I looked at the "Importing" project, which provides the
peak.util.imports package:

  http://peak.telecommunity.com/DevCenter/Importing

This looks like a good alternative to zope.deferredimport.  Maybe we
should deprecate zope.deferredimport in favor of Importing.  If there
are interesting things that depend on zope.deferredimport that we
don't want to update, we could reimplement zope.deferredimport using
Importing.

Importing has other nice features beyond lazy importing.

Personally, I'm going to start switching my uses of
zope.deferredimport to use Importing.

Jim

--
Jim Fulton


More information about the Zope-Dev mailing list