Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> I am not even sure this is a bug.

It really isn't :-)

But it is okay to want to improve the traceback.

Using _PyErr_FormatFromCause() is plausible, but the resulting traceback is 
messy.  Since there isn't much value in reporting which iterable number has 
failed, I prefer to just simplify the code with:

-            if (PyErr_ExceptionMatches(PyExc_TypeError))
-                PyErr_Format(PyExc_TypeError,
-                    "zip argument #%zd must support iteration",
-                    i+1);

The same change can also be applied to itertools.zip_longest().

----------
assignee:  -> rhettinger
components: +Library (Lib)
priority: normal -> low
versions: +Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37976>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to