1
Reply

What is namespace in Python?

Dinesh Beniwal

Dinesh Beniwal

5y
1.2k
1
Reply

    Namespaces in Python are implemented as Python dictionaries, so we can say like, it is a mapping from names (keys) to objects (values). The user doesn’t have to know this to write a Python program and when using namespaces.
    Namespaces in Python:
    • global names of a module
    • local names in a function or method invocation
    • built-in names: this namespace contains built-in functions (e.g. abs(), cmp(), …) and built-in exception names