Project organization and import

sjdevnull at sjdevnull at
Wed Mar 7 00:09:50 CET 2007

On Mar 6, 12:49 pm, "Martin Unsal" <martinun... at> wrote:
> On Mar 6, 9:19 am, "Chris Mellon" <arka... at> wrote:
> > You do? Or do you only have trouble because you don't like using "from
> > foo import Foo" because you need to do more work to reload such an
> > import?
> More work, like rewriting __import__ and reload??? :)
> There's a point where you should blame the language, not the
> programmer. Are you saying I'm lazy just because I don't want to mess
> with __import__?
> > What makes you think that the exposed namespace has to be isomorphic
> > with the filesystem?
> I don't; you do!
> I was clearly talking about files and you assumed I was talking about
> namespace. That's Pythonic thinking... and I don't mean that in a good
> way!
> > If you want to break a module into multiple packages and then stick
> > the files that make up the package in bizarre spots all over the
> > filesystem, can you give a reason why?
> Because I have written a project with 50,000 lines of Python and I'm
> trying to organize it in such a way that it'll scale up cleanly by
> another order of magnitude. Because I've worked on projects with
> millions of lines of code and I know about how such things are
> organized. It's funny, I'm a newbie to Python but it seems like I'm
> one of the only people here thinking about it as a large scale
> development language rather than a scripting language.
> Martin

I'm still not clear on what your problem is or why you don't like
"from foo import bar".  FWIW our current project is about 330,000
lines of Python code.  I do a ton of work in the interpreter--I'll
often edit code and then send a few lines over to the interpreter to
be executed.  For simple changes, reload() works fine; for more
complex cases we have a reset() function to clear out most of the
namespace and re-initialize.  I don't really see how reload could be
expected to guess, in general, what we'd want reloaded and what we'd
want kept, so I have a hard time thinking of it as a language problem.

More information about the Python-list mailing list