[issue34648] Confirm the types of parameters of traceback.format_list and traceback.StackSummary.from_list post-3.5

Jelle Zijlstra report at bugs.python.org
Mon Sep 24 11:41:06 EDT 2018


Jelle Zijlstra <jelle.zijlstra at gmail.com> added the comment:

> How people can get Iterable[FrameSummary] as an input and pass it to format_list()?

If I want to format a traceback, but omit traceback lines that refer to a particular module (for example, code for a coroutine runner), I could write `format_list(filter(lambda fs: 'asyncio' not in fs.filename, extract_stack())`.

I would also favor broadening the documented argument type for `format_list()` to say it accepts an iterable of FrameSummaries. No code change is necessary and it makes the code more flexible.

----------
nosy: +Jelle Zijlstra

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34648>
_______________________________________


More information about the Python-bugs-list mailing list