Reputation: 1076
Everyone seems to use different terms for this, such as modules, packages, libraries and whatnot. Is there a PEP recommended/encouraged term?
Upvotes: 1
Views: 197
Reputation: 61
A module and package are fairly well defined in Python, insofar as they represent very specific organizational code units.
Quoting from the Glossary:
Module: An object that serves as an organizational unit of Python code. Modules have a namespace containing arbitrary Python objects
Package: (...) Technically, a package is a Python module with an
__path__
attribute.
I am not aware of a PEP that defines other terms such as external library.
Upvotes: 2
Reputation: 20239
Best thing is to check the Python's documentation. Quoting from https://docs.python.org/3/tutorial/modules.html#packages :
Packages are a way of structuring Python’s module namespace by using “dotted module names”. For example, the module name A.B designates a submodule named B in a package named A. Just like the use of modules saves the authors of different modules from having to worry about each other’s global variable names, the use of dotted module names saves the authors of multi-module packages like NumPy or Pillow from having to worry about each other’s module names.
As for libraries, I haven't heard this being used officially in the Python literature.
Upvotes: 1