On Sun, May 10, 2020 at 2:17 PM Richard Damon Richard@damon-family.org wrote:
An error like character (whatever) is not a quote (or is not a minus+0060 sign) seems similar. It is one thing to not recognize a funny character in the language, but to actually parse it well enough to give a message that says in effect, that may look like a quote to you, but I am not going to treat is as one, sounds perverse in the language.
There are, I think, 28 quote-like characters in Unicode ( https://unicode-table.com/en/sets/quotation-marks/). Actually, probably more; I think U-0060, backtick/grave is not included, for example. Some of those are really supposed to be in particular pairs, others are interchangeably left or right. Which pairs combine is specific to the human language you write in, and also to the style guide you are following.
I very much want NOT to make a set of rules for what quotes are allowed when. But simply detecting "that's a quote character, but not the kind Python likes" is much easier than that. Obviously, all of these fancy-quotes are perfectly fine inside of generic Python quotes, as strings. "Doing the obvious thing" is throwing a SyntaxError, but ideally one that is a little more descriptive than currently, as Ned and others have stated.