New submission from Jeong-Min Lee:

Running the Pretty top example 
(http://docs.python.org/dev/library/tracemalloc.html#pretty-top) in the 
tracemalloc module documentation causes a ValueError.


    Traceback (most recent call last):
      File "t.py", line 32, in <module>
        display_top(snapshot, 10)
      File "t.py", line 9, in display_top
        top_stats = snapshot.statistics(group_by)
      File "/home/falsetru/h/cpython/Lib/tracemalloc.py", line 449, in 
statistics
        grouped = self._group_by(key_type, cumulative)
      File "/home/falsetru/h/cpython/Lib/tracemalloc.py", line 395, in _group_by
        raise ValueError("unknown key_type: %r" % (key_type,))
    ValueError: unknown key_type: 10

The last line of the example should be:

    display_top(snapshot, limit=10)

or:

    display_top(snapshop)

----------
assignee: docs@python
components: Documentation
messages: 212493
nosy: Jeong-Min.Lee, docs@python
priority: normal
severity: normal
status: open
title: tracemalloc example
versions: Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20814>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to