packages and __init__.py abuse

Edward Povazan epovazan at NO-SPAM-ME-telus.net
Tue Dec 4 01:57:51 EST 2001


Hello,

Being quite new to python, I want to make sure that what I am thinking of
doing is considered ok in the python world.

Say I have a module mymodule.py and I decide that I could regroup some
things to create a "submodule":
mymodule
mymodule.mysubmodule

The only way I see I can do this is by having folders:
/mymodule/mysubmodule,
and by placing the contents of the original mymodule.py into
/mymodule/__init__.py

This works, but is this considered bad? Is there an alternative? From my
testing (using Jython btw), I haven't found one.

Thanks
-Ed





More information about the Python-list mailing list