What's the difference between a Python module and a Python package?

前端 未结 5 1217
难免孤独
难免孤独 2020-11-22 11:46

What\'s the difference between a Python module and a Python package?

See also: What's the difference between "package" and "module" (for othe

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 12:27

    A late answer, yet another definition:

    A package is represented by an imported top-entity which could either be a self-contained module, or the __init__.py special module as the top-entity from a set of modules within a sub directory structure.

    So physically a package is a distribution unit, which provides one or more modules.

提交回复
热议问题