On Fri, 1 May 2020 at 10:29, Steven D'Aprano <steve@pearwood.info> wrote:
[...]
> "Is it UnpackingOverflowException or PackingUnderflowError or
> TooManyValuesUnpackException or ValueUnpackingError or ...???"

> It took me far too long to learn the difference between
> UnicodeEncodingError and UnicodeDecodingError. Or is it
> UnicodeEncodeError and UnicodeDecodeError?
>
> It is possible to have too many fine-grained errors as well as too
few.

This is thinking about exceptions and the proposal too simply. When I read this, I (a) found out that this exception is a built-in so it isn't hard to find out which is which (any IDE or IPython would help) but more importantly, looking at their MRO, if you cannot understand the difference, and you don't have to, you could instead choose to catch UnicodeError instead (or the combination of both).

However, if you just want to catch encoding errors you can, and this is the crux of this proposal: allowing similar catches throughout the standard library as a first class citizen seems sensible to me and I am +1 of this proposal.