What is a `namespace` in python?

may anyone explain the meaning of " namespace " in python ?

Other languages might use that word for something specific, python doesn’t.

It’s spaces for names, similar to how two directories in your file system are spaces where filenames may be, and two different spaces can have something with the same name in it, but they’re still different things because they’re in different spaces.

A module (a .py file usually) is a namespace, you can define names (variables) there.

34 Likes

@ionatan THANKS FOR MAKING THAT CLEAR !!

4 Likes

The namespace in python is another term for the scope.

So if i understand correctly, namespace is just like a different folder in file system, we cannot store file with exactly same name but we can do so in different folders. Did i get that right?