Hacker News new | past | comments | ask | show | jobs | submit login

Since Python is an interpreter, it keeps a dictionary/hash table of the local and global variables. These can be accesses by the functions `locals()` and `globals()`.

`a = ... ` can be thought of as `locals()["a"] = ...`

(although you can should not actually modify the local variables this way)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: