- #1
fog37
- 1,568
- 108
Hello Forum,
In Python, my understanding is that functions, after being created, use their own memory space in RAM to hold the values of their local variables, etc. The main code (caller program) also has its own and different memory space, etc.
Do these memory spaces represent different "namespaces"? What determines when something is inside a certain namespace or another?
For example, when we create a simple variable x=5 at the prompt, what namespace is that saved in?
Namespaces are critical in the context of local and global variables so they don't get mixed up, I would say.
Thanks as usual.
Fog37
In Python, my understanding is that functions, after being created, use their own memory space in RAM to hold the values of their local variables, etc. The main code (caller program) also has its own and different memory space, etc.
Do these memory spaces represent different "namespaces"? What determines when something is inside a certain namespace or another?
For example, when we create a simple variable x=5 at the prompt, what namespace is that saved in?
Namespaces are critical in the context of local and global variables so they don't get mixed up, I would say.
Thanks as usual.
Fog37