Cross-reference 'import' in a class hierarchy

Greg Ewing (using ckea25d02 at
Tue Apr 8 07:34:33 CEST 2003

Jeremy Bowers wrote:
> IMHO, this is the largest wart by far in Python when it comes to writing
> "real" programs that really shouldn't have every file dumped into the same
> directory.

It's actually not so bad in the case of an *application*,
because if you structure your application like this:

etc., then when you do


the directory containing effectively becomes a
source of top-level packages for the duration, so you can
refer to MyAppPkg.mymodule1 etc.

It's more of a problem when, e.g. you want to embed a
library as a subpackage of another library, and the
embedded library itself consists of subpackages which
would like to refer to each other without having to
care where they reside in the global picture.

Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand

More information about the Python-list mailing list