Basic importing question

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Wed Aug 20 13:39:54 CEST 2008


Hussein B a écrit :
(snip)
> One more question:
> If I have this structure:
> orig/com/domain/project/Klass1.py
>                         Klass2.py
>                         __init__.py
> 
> Why com, domain, project should have __init__.py also?

Yes, why should they ? Unless you want to mimic Java's package system so 
you do "import com.domain.project.stuff" - which is IMHO a pretty bad 
idea -, there's just no reason to turn all your filesystem into a python 
package.

Python's philosophy here is that flat is better than nested.



More information about the Python-list mailing list