The role and usage of package __init__

The role and usage of package __init__

init major role in .py it is:

  1. The identifier of the package in Python cannot be deleted

  2. Define __all__ to fuzzy import

  3. Write Python code (it is not recommended to write python module in __init__, you can create another module in the package to write, try to keep __init__.py simple)

Guess you like

Origin blog.csdn.net/weixin_46239293/article/details/113881933