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

Reply via email to