Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
adrian17
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
151.
▲
by
adrian17
9y ago
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 var