<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body><div style="font-family:Helvetica,Arial;font-size:13px"><br></div><br><div class="gmail_signature">I more or less get most of python’s major features. I think. One thing I’m not able to understand however, is __init__.py. I understand that: </div><div class="gmail_signature"><br></div><div class="gmail_signature">* you’re supposed to use it when you organize your code into directories, and this namespaces/groups the directory contents into a module</div><div class="gmail_signature">* its contents is executed (at some point?)</div><div class="gmail_signature"><br></div><div class="gmail_signature">Most of what I can find about it mentions creating __init__.py as an empty file and why, but then doesn’t go on to suggest what the contents should be. I’ve been trying to use it as a way to organize import statements, but to be honest I can’t make sense of why it works sometimes and not others, why it might work in one sibling directory, but not another, and so on.</div><div class="gmail_signature"><br></div><div class="gmail_signature">I have this impression that the contents of the file are supposed to be a hint or suggestion or automated way for other things to say ‘import &lt;module_dir&gt;` and dir’s __init.py__ will in turn import local modules on behalf of the caller?</div><div class="gmail_signature"><br></div><div class="gmail_signature">What is __init.py__ supposed to contain? Other than being an empty file, does it serve any purpose, provide anything for your code?</div><div class="gmail_signature"><br></div><div class="gmail_signature">Thanks!</div></body></html>