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 Nathaniel Manista
Recipients Nathaniel Manista, berker.peksag, docs@python, srittau
Date 2018-09-20.16:09:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1537459799.72.0.956365154283.issue34648@psf.upfronthosting.co.za>
In-reply-to
Content
> 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 think that’s an unnecessarily and extraordinarily narrow reading - you could use the same reading to make a judgement of “format_list may only be passed values returned by extract_tb and extract_stack rather than other values of the same type”, and that would be absurd.

I don’t think it’s a wise choice to say “because the motivation for offering the format_list function was to work with values returned by extract_tb and extract_stack, the allowed inputs to format_list should be restricted to just those types”.

Why not support Iterable[FrameSummary]? A choice to support Iterable[FrameSummary] *is also a choice to support List[FrameSummary]*. It's just a "wider" choice; it’s not a breaking choice to drop support for List[FrameSummary].

> I don't think we support the "pass manually created iterables" case here.

What’s a “manually created iterable”? What kinds of iterables aren’t “manually created iterables”? Can their differences be captured in the type system?

> Yes, the old API is still supported for backwards compatibility reasons.

This is a very flat statement that invites questions by what it doesn’t say and by the way it describes something that is true today without saying for how long into the future that thing will remain true. For how long will the old API be supported for backwards compatibility reasons? Is new code encouraged to use the new API? If the new API is better, shouldn’t new code use it? If the new API isn’t better, why was it introduced?
History
Date User Action Args
2018-09-20 16:09:59Nathaniel Manistasetrecipients: + Nathaniel Manista, srittau, docs@python, berker.peksag
2018-09-20 16:09:59Nathaniel Manistasetmessageid: <1537459799.72.0.956365154283.issue34648@psf.upfronthosting.co.za>
2018-09-20 16:09:59Nathaniel Manistalinkissue34648 messages
2018-09-20 16:09:59Nathaniel Manistacreate