durusmail: quixote-users: [patch] _q_import
[patch] _q_import
[patch] _q_import
2002-12-02
2002-12-03
2002-12-03
2002-12-04
2002-12-07
2002-12-07
2002-12-09
2002-12-09
2002-12-05
[patch] _q_import
Jonathan Corbet
2002-12-05
> Currently, _q_getname only gets called for names not in _q_exports.  We
> could change it so that _q_getname was also called if name was in
> _q_exports but not in the namespace.

This could maybe be made to work, but:

> An example lazy importing _q_getname would be:
>
>     def _g_getname(request, component):
>         global something
>         if component == 'something':
>             from somewhere import something

How does Quixote know that _q_getname did an import in this case?  It seems
that, at least, _q_getname would need to return the resulting module.

Anyway, this could be made to work for me, as long as the import case can
return either a module (and traversal continues, possibly looking for
_q_index), or something callable.  I think it should "just work."

> Does that meet your needs?  There is a minor backwards incompatibility
> with this idea.  Applications with modules that have both a _q_getname
> and rely on automatic importing would break.

Gee, a Quixote release that broke something?  I've never heard of that
before...:)  Is anybody even using the automatic importing now?  It's not a
documented feature, you have to dig fairly deep into the publisher to even
know that it's possible.

jon

Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net

reply