[[Import-sig] RFC: an import "concentrator" __init__.py]
Mon, 13 Mar 2000 23:58:29 +0100 (MET)
Niki Spahiev wrote:
> I found similar module LazyModule.py in mxDATETIME and mxODBC.
> Have you looked at it? Maybe the merge of two would be useful?
I haven't looked into 'mxODBC', but since this is also from
Marc-Andre Lemburg, I guess it is identical to the 'LazyImp.py', which
is available "stand-alone". Yes: I had a look into it, and no
I don't believe the two approaches can be merged very easy.
AFAIK both approaches try to accomplish different things.
The common part is to delay importing of certain modules.
The not so common part is the manipulation of name spaces.
The Pmw loader and my simplified lazy loader have in common, that
they effect only one package: The package in which they are used.
So using this approach seems to be far less "dangerous" in the
context of a larger application using many different packages than
fiddling with the Python import machinery in general.
I've read the rather detailed info page about this SIG.
But from looking at Greg Stein's imputil.py I felt unable
to accomplish the same two goals as I did with this straight
forward simple lazy import __init__.py. That was the reason to
post this request for comments in the first place, also my post
might be a bit off-topic for this SIG.
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)