[Python-Dev] Updated PEP 454 (tracemalloc): no more metrics!

Victor Stinner victor.stinner at gmail.com
Sun Oct 27 19:02:40 CET 2013


Hum, timestamp and traceback_limit attributed of GroupedStats can also be
removed, they are just of the same attribute of the Snapshot class and
GroupedStats is created from Snapshot.group_by().

Le 27 oct. 2013 17:26, "Victor Stinner" <victor.stinner at gmail.com> a écrit :
> * do you have a better suggestion for GroupedStats.stats attribute or
> GroupedStats.statistics() method: "stats" and "statistics" are too
> close

An option is to modify GroupedStats to inherit from dict, so
GroupedStats.stats would be GroupedStats directly.

> * should GroupedStats.statistics() and GroupedStats.compare_to()
> always sort the result to drop the sort=True parameter?

The result is a list which can be bigger than 100,000 items. The question
is if it would inefficient to sort the list twice.

Another option is to replace sort parameter with a new sort_key parameter
(callable), passed to list.sort as the ke parameter.

Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131027/9933589d/attachment.html>


More information about the Python-Dev mailing list