[Python-Dev] [Python-checkins] cpython: Close #19762: Fix name of _get_traces() and _get_object_traceback() function
jimjjewett at gmail.com
Mon Nov 25 16:04:21 CET 2013
Why are these functions (get_traces and get_object_traceback) private?
(1) Is the whole module provisional? At one point, I had thought so, but
I don't see that in the PEP or implementation. (I'm not sure that it
should be provisional, but I want to be sure that the decision is
(2) This implementation does lock in certain choices about the nature of
traces. (What data to include for analysis vs excluding to save memory;
which events are tracked separately and which combined into a single total;
organizing the data that is saved in a hash by certain keys; etc)
While I would prefer more flexibility, the existing code provides a
reasonable default, and I can't forsee changing traces so much that these
functions *can't* be reasonably supported unless the rest of the module API
(3) get_object_traceback is the killer app that justifies the specific
data-collection choices Victor made; if it isn't public, the implementation
starts to look overbuilt.
(4) get_traces is about the only way to get at even the all the data that
*is* stored, prior to additional summarization. If it isn't public, those
default summarization options become even more locked in..
On Mon, Nov 25, 2013 at 3:34 AM, victor.stinner
<python-checkins at python.org>wrote:
> changeset: 87551:2e2ec595dc58
> user: Victor Stinner <victor.stinner at gmail.com>
> date: Mon Nov 25 09:33:18 2013 +0100
> Close #19762: Fix name of _get_traces() and _get_object_traceback()
> name in their docstring. Patch written by Vajrasky Kok.
> Modules/_tracemalloc.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
> diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
> --- a/Modules/_tracemalloc.c
> +++ b/Modules/_tracemalloc.c
> @@ -1018,7 +1018,7 @@
> - "get_traces() -> list\n"
> + "_get_traces() -> list\n"
> "Get traces of all memory blocks allocated by Python.\n"
> "Return a list of (size: int, traceback: tuple) tuples.\n"
> @@ -1083,7 +1083,7 @@
> - "get_object_traceback(obj)\n"
> + "_get_object_traceback(obj)\n"
> "Get the traceback where the Python object obj was allocated.\n"
> "Return a tuple of (filename: str, lineno: int) tuples.\n"
> Repository URL: http://hg.python.org/cpython
> Python-checkins mailing list
> Python-checkins at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev