
Dec. 4, 2022
8:24 p.m.
On Sun, Dec 4, 2022, 2:08 PM Chris Angelico <rosuav@gmail.com> wrote:
You're not the first to try to use globals() for this, but it means that the context manager works ONLY at top-level.
True. I know that. But if you're inside a function, you already have scope containment, so the issue feels like "so what?" But doh! I always forget about which way the locals() / globals() mutability thing goes. A regular del without exec is better, of course.