Module/package hierarchy and its separation from file structure

Peter Schuller peter.schuller at
Tue Jan 29 13:48:59 CET 2008

> You can also put, in animal/
>  from monkey import Monkey
> and now you can refer to it as org.lib.animal.Monkey, but keep the  
> implementation of Monkey class and all related stuff into  
> .../animal/

The problem is that we are now back to the identity problem. The class
won't actually *BE* org.lib.animal.Monkey. Perhaps manipulating
__module__ is enough; perhaps not (for example, what about
sys.modules?). Looks like I'll just live with putting more than I
would like in the same file.

/ Peter Schuller

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller at>'
Key retrieval: Send an E-Mail to getpgpkey at
E-Mail: peter.schuller at Web:

More information about the Python-list mailing list