Baptiste Carvello wrote:
Le 14/04/2021 à 19:44, Guido van Rossum a écrit :
No, what I heard is that, since in *most* cases the string quotes are not needed, people are surprised and annoyed when they encounter cases where they are needed.
Well, I had assumed quotes would be used in all cases for consistency.
That does seem like a reasonable solution. Redundant, ugly, and annoying, but safe and consistent. Sort of like using type constraints in the first place. :D
... the rule for finding the end of an annotation would be very simple -- just skip words until the next comma, close paren or colon, skipping matching brackets etc.
... But the hypothetic "def foo(prec: --precision int):" is already less readable. Will finding the closing comma or colon always be obvious to the human reader?
Nope. "--" sometimes means "ignore the rest of the line, including the ")". At the moment, I can't remember where I've seen this outside of SQL, but I can guarantee that if I read it late enough at night, the *best* case would be that I notice the ambiguity, guess correctly and am only annoyed.