AI engineering glossary · Python core

What is namespace?

Namespace: A mapping from names to objects, such as the built-ins, a module's globals or a function's locals. Different namespaces let the same name exist in separate places without clashing. Namespaces are how Python keeps names from different modules and functions from colliding with each other.

Level: intermediateTopic: Python core

Namespace: an example

math.pi and my_module.pi are different names in different namespaces, so they do not conflict.

Related terms

More Python core terms

Where you learn it

Namespace is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.