On Sun, May 10, 2020 at 12:57:11PM -0700, Andrew Barnert via Python-ideas wrote:
Can the error message actually include the Unicode character itself?
I can think of cases where that could be confusing, or mess up the display of the error message. E.g. if it were an invisible character, or swapped to right-to-left display, or similar. So one would have to be careful about just blindly displaying an arbitrary Unicode character.
A novice isn’t going to know what U+201c means
And that's why we have user forums, Stackoverflow, r/learnpython and Google.
There's a temptation to fill the error messages with more and more detail, but we should remember:
- The users who would most benefit from that extra detail don't read error messages; this isn't just folklore, people have done real studies and found that beginners and end-users don't read error message.
- And the longer the error message, the more intimidating they are to the beginners we are trying to help.
Error messages should be brief and to the point, without being too terse. They have no obligation to explain all the whys and wherefores of the error. And no matter what you say, a large proportion of beginners will pay no attention to it at all.
We shouldn't only think about how useful that extra detail will be the first time we see it, but how useful it will be the ten thousandth time we see it. If you can imagine your eyes glazing over the details in the error message, then that's a hint that it should have been there in the first place. (That's a general observation, not specifically aimed at Andrew's request for the character to be displayed.)