[issue17934] Add a frame method to clear expensive details

2013-08-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I committed the RuntimeError-raising version. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker _

[issue17934] Add a frame method to clear expensive details

2013-08-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 862ab99ab570 by Antoine Pitrou in branch 'default': Issue #17934: Add a clear() method to frame objects, to help clean up expensive details (local variables) and break reference cycles. http://hg.python.org/cpython/rev/862ab99ab570 -- nosy:

[issue17934] Add a frame method to clear expensive details

2013-08-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an updated patch. Any objections to committing? -- Added file: http://bugs.python.org/file31132/frame_clear_alt3.patch ___ Python tracker __

[issue17934] Add a frame method to clear expensive details

2013-06-18 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- dependencies: +PEP 442 implementation ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue17934] Add a frame method to clear expensive details

2013-05-25 Thread STINNER Victor
STINNER Victor added the comment: I may be safer to initialize f->f_executing to 1 at the creation of the frame, and only change its value to 0 when the execution is done. (The name of the attribute may also be changed.) I don't know if it is possible, but a frame should not be cleared just be

[issue17934] Add a frame method to clear expensive details

2013-05-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: I will probably wait for PEP 442 adoption before finalizing this issue. -- dependencies: -Generator cleanup without tp_del ___ Python tracker _

[issue17934] Add a frame method to clear expensive details

2013-05-13 Thread Guido van Rossum
Guido van Rossum added the comment: A downside of using this is that some extended traceback printers (such as cgitb.py in the stdlib, or and some things I've seen in web frameworks) won't be able to print the locals. And pdb's pm() function would lose its value too. So it'll remain a judgme

[issue17934] Add a frame method to clear expensive details

2013-05-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch addressing some of Nick's comments. -- Added file: http://bugs.python.org/file30252/frame_clear_alt2.patch ___ Python tracker ___

[issue17934] Add a frame method to clear expensive details

2013-05-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an alternative patch raising RuntimeError on executing frames. Please tell which one you prefer :) -- Added file: http://bugs.python.org/file30244/frame_clear_alt.patch ___ Python tracker

[issue17934] Add a frame method to clear expensive details

2013-05-12 Thread Nick Coghlan
Nick Coghlan added the comment: +1 to all Antoine's replies :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue17934] Add a frame method to clear expensive details

2013-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Mostly looks good to me, but I think I'd prefer that attempts to clear > a running frame raise RuntimeError with an appropriate message. Hmm, why not. My intuition was to make frame.clear() a best-effort method, but this sounds ok too. > I also wonder how thi

[issue17934] Add a frame method to clear expensive details

2013-05-12 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue17934] Add a frame method to clear expensive details

2013-05-11 Thread Nick Coghlan
Nick Coghlan added the comment: Mostly looks good to me, but I think I'd prefer that attempts to clear a running frame raise RuntimeError with an appropriate message. I also wonder how this might relate to Eric Snow's proposal to reference the currently executing function from the frame object

[issue17934] Add a frame method to clear expensive details

2013-05-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch to avoid clearing executing frames. Note that the new f_executing member should be re-usable to compute gi_running without storing it. -- Added file: http://bugs.python.org/file30225/frame_clear2.patch

[issue17934] Add a frame method to clear expensive details

2013-05-11 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch. Guido, I would hope this may be useful to you. -- keywords: +patch nosy: +gvanrossum stage: needs patch -> patch review Added file: http://bugs.python.org/file30224/frame_clear.patch ___ Python tracke

[issue17934] Add a frame method to clear expensive details

2013-05-08 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- dependencies: +Generator cleanup without tp_del ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue17934] Add a frame method to clear expensive details

2013-05-08 Thread Antoine Pitrou
New submission from Antoine Pitrou: I think we may want to add a finalize() or close() method on frame objects which would clear all local variables (as well as dereference the globals dict, perhaps), after having optionally run a generator's close() method (if the frame belongs to a generator