[Muchly snipped]
On 09/04/2020 12:27, Soni L. wrote:
To put it simple, unpacking raises ValueError:
But if the iterator raises ValueError, there's no way to tell it apart
from the unpacking:
I don't see how this is any different from any other case when you get
the same exception for different errors. If for some reason you really
care, subclass ValueError to make a finer-grained exception.
And the workaround for this is a bit ugly. We already convert e.g.
StopIteration into RuntimeError in many cases, why can't we do so here too?
Surely the correct "workaround" is not to do the thing that raises the
exception?
--
Rhodri James *-* Kynesim Ltd
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/JIOFUZPUDWZJRLNXIYVAWVHT4XDXQMAF/
Code of Conduct: http://python.org/psf/codeofconduct/