Terry J. Reedy <[email protected]> added the comment:
Minimal example
>>> a{ # or
>>> a {
In 3.8, this is immediately flagged as a SyntaxError. In 3.9 and master, a
continuation prompt is issued. This strikes me as a parsing buglet that should
preferably be fixed, as it implies that something valid *could* follow '{',
thus misleading beginners. On the other hand, after scanning my keyboard, '{'
seems unique in being a legal symbol, unlike `, $, and ?, or combinations like
+*, that can AFAIK never follow a name. So it would need special handling.
Side note: for the same reason I dislike the { change, I like the generic 3.9
change for legal operators without a second operand.
>>> a *
Both flag as SyntaxError, but in 3.8, the caret is under '*', falsely implying
that '*' cannot follow a name, while in 3.9, it is under the whitespace
following, correct implying that the * is legal and that the problem is lack of
a second expression (on the same line without continuation).
----------
nosy: +terry.reedy
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41659>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com