Message325313
> 1) I know it has the name "format_list", but is it really intended to require a
> list? Why not a sequence, or a collection, or an iterable? I would think it would
> be fine to pass an iterable to traceback.format_list. Is it fine?
In 3.4, format_list() was documented to accept return values of extract_tb() and extract_stack() functions and they both were returned lists:
def extract_tb(tb, limit=None):
return list(_extract_tb_iter(tb, limit=limit))
def extract_stack(f=None, limit=None):
stack = list(_extract_stack_iter(_get_stack(f), limit=limit))
stack.reverse()
return stack
I don't think we support the "pass manually created iterables" case here.
> 2) What is the desired component type for the aggregate passed to
> format_list? In 3.4-and-earlier it was Tuple[str, int, str,
> Optional[str]], and that still works in 3.5-through-3.8, but is that
> just backwards compatibility [...]
Yes, the old API is still supported for backwards compatibility reasons. |
|
Date |
User |
Action |
Args |
2018-09-14 00:14:28 | berker.peksag | set | recipients:
+ berker.peksag, srittau, docs@python, Nathaniel Manista |
2018-09-14 00:14:28 | berker.peksag | set | messageid: <1536884068.66.0.956365154283.issue34648@psf.upfronthosting.co.za> |
2018-09-14 00:14:28 | berker.peksag | link | issue34648 messages |
2018-09-14 00:14:28 | berker.peksag | create | |
|