Any folder that contains __init___
becomes a Python package.
__init___
serves to:
Meaning, you should place __init__.py
in a directory to make it a package, allowing you to import modules from that directory.
# myapp/routes/__init__.py from .routes import users from .routes import products from .routes import orders # external from myapp.routes import users
Class
__init__
is a constructor in a python class:
class MyClass: def __init__(self, name): self.name = name