> . . .
> ... 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.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/SRPOQQ2R33ZJKQC3SHEIE7YMTZDO3EEE/
Code of Conduct: http://python.org/psf/codeofconduct/