What do you use __init__.py for?

redefined.horizons at gmail.com redefined.horizons at gmail.com
Thu Apr 27 15:15:32 EDT 2006


I have just started learning about Python Packages. I know that a
directory must contains the '__init__.py'  script to be considered a
Python package, and that this script is executed when the package is
imported.

But what other uses does the '__init__.py'  script have? What do you
use it for?

I imagine it could provide, at the least, some helpful metadata about
the contents and dependencies of the package.

I'm just looking for ideas...

Thanks,

Scott Huey




More information about the Python-list mailing list