Namespace

A namespace is a container that groups names (like variables and functions) so identical names in different namespaces do not collide.

General Programming

Namespaces are like surnames for code: two people can both be named 'Sam' if they have different surnames. Modules, classes, and packages all create namespaces.

Examples

Python

import math
print(math.pi)   # pi lives in the math namespace

Output:

3.141592653589793

See also

Back to the Dictionary