Reposted my SO question here.
I found this paragraph in Python’s documentaton:
I have a few questions:
finallymake destruction deterministic? What’s the difference between
try ... finally: del frameand
Suppose I have many functions that use frame, and I want to create a decorator to help me avoid having to write
del frameevery time, something like:
def del_frame(f): def inner(frame): try: return f(frame) finally: del frame return inner @del_frame def function_that_uses_frame(frame): # This function will take a `frame` object from somewhere else. ...
Does it conform to the requirements of frame destruction despite that I didn’t delete the