News for hackers. Stuff that matters.
Re:Diving into the world of hash tables by adrian17 on Monday June 26, 2017 @01:45AM (#14634381)
This only works in global scope. It won't work in a function:

    def f():
        a = 5
        locals()['a'] = 6
        print(a) # 5
Inside a function, accesses/writes of locals use an internal array of local variables, to skip dicts. Same with constants. See:

https://github.com/python/cpython/blob/master/Python/ceval.c...

There are no comments on this comment yet.