[issue19146] Improvements to traceback module

STINNER Victor report at bugs.python.org
Wed Oct 2 22:18:30 CEST 2013


STINNER Victor added the comment:

> It adds extract_tb_ex() and extract_stack_ex() functions ...

I don't like "_ex" suffixes, it's not future proof if we need to add another function later.

You may rename them using "_iter" suffix and return an iterator instead of a list. Such idea was also proposed for os.listdir() => os.scandir() / os.iterdir(). See the discussion in #11406. The caller can write tuple(extract_stack_iter()), as I do with dict.items() to sort a dictionary.

> Feedback?

I like unit tests :-) The patch should also document new functions.
You may only need the most recent frames.

----------
nosy: +haypo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19146>
_______________________________________


More information about the Python-bugs-list mailing list