This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients akuchling, ghazel, loewis, pconnell, pitrou, r.david.murray, terry.reedy, tim.peters, vstinner
Date 2013-09-09.20:20:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I tried to implement the feature as a new traceback.clear_frames() method. I tried to follow the chain of frame objects (using frame.f_back), but it does not work as expected. The method needs to follow the chain of traceback objects (tb.tb_next). So it makes sense to define a function instead of a method (a method usually only affect the object, not a chain of objects).


- I didn't see the "tb" abbreviation in other places in Python, except for traceback attributes. I prefer clear_traceback_frames(). The name clear_frames() is maybe better because traceback is already known by the context (the module is called "tracback". Example: traceback.clear_frames(tb) instead of traceback.clear_traceback_frames(tb).

- The documentation is wrong: frame.clear() does not guarantee to clear *all* locals, but only *most* locals:

"F.clear(): clear most references held by the frame");

So I suggest a more permissive documentation:

"Clear most reference held by frames."
Date User Action Args
2013-09-09 20:20:37vstinnersetrecipients: + vstinner, tim.peters, loewis, akuchling, terry.reedy, pitrou, ghazel, r.david.murray, pconnell
2013-09-09 20:20:37vstinnersetmessageid: <>
2013-09-09 20:20:37vstinnerlinkissue1565525 messages
2013-09-09 20:20:37vstinnercreate