Author pablogsal
Recipients aeros, eric.smith, gvanrossum, lys.nikolaou, pablogsal, petr.viktorin, serhiy.storchaka, vstinner
Date 2020-04-29.19:28:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588188534.37.0.260796378598.issue40246@roundup.psfhosted.org>
In-reply-to
Content
> If it's all handled by the tokenizer, how come it's different in the newparser?

Is not different in the new parser: both parsers have analogous behaviour now:

~/github/python/master master
❯ ./python
Python 3.9.0a6+ (heads/master:84724dd239, Apr 29 2020, 20:26:52)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> norm=lambda m: m+(m and(m[-1]!='\n'and'\n'or'')or'\n')
  File "<stdin>", line 1
    norm=lambda m: m+(m and(m[-1]!='\n'and'\n'or'')or'\n')
                                         ^
SyntaxError: invalid string prefix
>>>

~/github/python/master master
❯ ./python -X oldparser
Python 3.9.0a6+ (heads/master:84724dd239, Apr 29 2020, 20:26:52)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> norm=lambda m: m+(m and(m[-1]!='\n'and'\n'or'')or'\n')
  File "<stdin>", line 1
    norm=lambda m: m+(m and(m[-1]!='\n'and'\n'or'')or'\n')
                                       ^
SyntaxError: invalid string prefix


This issue is exclusively due to the changes in https://github.com/python/cpython/pull/19476 if I understand correctly.
History
Date User Action Args
2020-04-29 19:28:54pablogsalsetrecipients: + pablogsal, gvanrossum, vstinner, eric.smith, petr.viktorin, serhiy.storchaka, lys.nikolaou, aeros
2020-04-29 19:28:54pablogsalsetmessageid: <1588188534.37.0.260796378598.issue40246@roundup.psfhosted.org>
2020-04-29 19:28:54pablogsallinkissue40246 messages
2020-04-29 19:28:54pablogsalcreate