
Dec. 6, 2022
9:17 a.m.
. . . ... for _var in list(globals()): . . . ... exec(f"del {_var}", globals()) . . . ...globals()... There's a more complicated solution that uses only the locals that requires getting the previous frame and using `ctypes.pythonapi.PyFrame_LocalsToFast`, but that goes too much into complicated details, no? Not like it's already complicated enough anyway for something as simple as not reusing the same variable names and stuff like that.