What to place in __init__.py

Quiz yourself:
What are the three different ways __init__.py is commonly used? Which one do you prefer?

From standalone module to package

It's common to start with your code in a module, but later realize it should be better organized in a package structure.
If you already have other applications using your module, you can use __init__.py to maintain API compatibility with these other applications.

This effectively places teaspoon, knife and fork in the silverware namespace and allows dinnertable.py to still use from silverware import teaspoon even if teaspoon is defined in the silverware.spoons module and fork in the silverware.forks module.

Note

I used absolute imports in this example. You could, conceivably, use relative imports like this: