PyDocs

Nav

Python Runtime Services

frame.clear

builtins

method · Added in 3.4
  • frame.clear()
This method clears all references to local variables held by the frame. Also, if the frame belonged to a generator, the generator is finalized. This helps break reference cycles involving frame objects (for example when catching an exception and storing its traceback for later use).
Changed in 3.13
  • 3.13: Attempting to clear a suspended frame raises RuntimeError (as has always been the case for executing frames).
0 Examples
No examples for builtins/frame.clear.
See Also
No see-alsos for builtins/frame.clear
0 Notes
No notes for frame.clear