17 Sep
2020
17 Sep
'20
6:55 p.m.
On Thu, Sep 17, 2020 at 8:49 PM Chris Angelico
The only time you can safely mutate locals() is when you're at top level and it's the same as globals().
It's safe in class definitions, right? At least in CPython it seems to work. I've done that a few times, most recently to dynamically generate enum members.