469,935 Members | 1,609 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,935 developers. It's quick & easy.

recursive import

oj
Hi, I'm just toying around with some ideas at the moment.

Is there an easy and safe way to recursivly import all modules under a
particular namespace?

Say, I had modules:

foo
foo.bar
foo.bar.baz
foo.baz
bar
bar.baz

I want to import all the modules in the foo namespace, so the first
four modules in that list.

Other then having those modules explicitly import their children, or
explicitly importing them all from where I want to use them, can I do
this? Should I do this?

The idea is that function decorates 'register' functions in those
modules, so they become available without having to have a list of all
the modules that contain them, and without all the modules necessarily
needing to know about each other.
Jul 1 '08 #1
0 789

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Stian Søiland | last post: by
7 posts views Thread by bearophileHUGS | last post: by
3 posts views Thread by Bernie | last post: by
7 posts views Thread by aurora | last post: by
2 posts views Thread by Martin Marcher | last post: by
18 posts views Thread by Just Another Victim of the Ambient Morality | last post: by
3 posts views Thread by from.future.import | last post: by
4 posts views Thread by Thomas Guettler | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.