2013/10/30 Stephen J. Turnbull <step...@xemacs.org>: > Just "reset" implies to me that you're ready to start over. Not just > traced memory blocks but accumulated statistics and any configuration > (such as Filters) would also be reset. Also tracing would be disabled > until started explicitly.
If the name is really the problem, I propose the restore the previous name: clear_traces(). It's symmetric with get_traces(), like add_filter()/get_filters()/clear_filters(). > Shouldn't disable() do this automatically, perhaps with an optional > discard_traces flag (which would be False by default)? The pattern is something like that: enable() snapshot1 = take_snapshot() ... snapshot2 = take_snapshot() disable() I don't see why disable() would return data. > But I definitely agree with Jim: You *must* provide an example here > showing how to save the traces (even though it's trivial to do so), > because that will make clear that disable() is a destructive > operation. (It is not destructive in any other debugging tool that > I've used.) Even with documentation, be prepared for user complaints. I added "Call get_traces() or take_snapshot() function to get traces before clearing them." to the doc: http://www.haypocalc.com/tmp/tracemalloc/library/tracemalloc.html#tracemalloc.disable Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com