[Tutor] __init__.py question

Marilyn Davis marilyn at pythontrainer.com
Wed Jun 1 01:44:53 CEST 2011


I don't really understand why __init__.py is necessary -- except that it
makes the packaging scheme work.

The Python Manual by Guido van Rossum and Fred L. Drake says:

... this is done to prevent directories with a common name, such as
string, from unintentionally hiding valid modules that occur later on in
the module search path.

An example would probably set me straight.  Can anyone help with that?

Marilyn Davis



More information about the Tutor mailing list