This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author berker.peksag
Recipients Nathaniel Manista, berker.peksag, docs@python, srittau
Date 2018-09-14.00:14:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536884068.66.0.956365154283.issue34648@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2018-09-14 00:14:28berker.peksagsetrecipients: + berker.peksag, srittau, docs@python, Nathaniel Manista
2018-09-14 00:14:28berker.peksagsetmessageid: <1536884068.66.0.956365154283.issue34648@psf.upfronthosting.co.za>
2018-09-14 00:14:28berker.peksaglinkissue34648 messages
2018-09-14 00:14:28berker.peksagcreate