简体   繁体   中英

What is the Python's recommended name for the external libraries?

Everyone seems to use different terms for this, such as modules, packages, libraries and whatnot. Is there a PEP recommended/encouraged term?

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 .

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 AB 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM