➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 mbussonn
收信人 Anthony Sottile, BTaskaya, gvanrossum, hauntsaninja, lys.nikolaou, mbussonn, ned.deily, pablogsal, serhiy.storchaka
日期 2020-05-10.23:44:02
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1589154243.07.0.470353106947.issue40334@roundup.psfhosted.org>
In-reply-to
内容
Seem to not be in the new parser but simply in codeop in particular `def _maybe_compile`

The logic seem weird (but weird logic usually have a reason), it try to compile thrice by appending many `\n`.

1) Why do that and not return the first successful compile directly ? I'm not sure. 
2) It does compare the repr of error when  compile(source + "\n") and compile(source+'\n\n') and only raise if both are identical (which they are not in the new parser, they differ by `\n`...)

SyntaxError('invalid syntax', ('<input>', 1, 6, 'def a-b')) 
vs
SyntaxError('invalid syntax', ('<input>', 1, 6, 'def a-b\n'))


This logic seem to go back to the 2000s.
历史
日期 用户 动作 参数
2020-05-10 23:44:03mbussonn修改recipients: + mbussonn, gvanrossum, ned.deily, serhiy.storchaka, Anthony Sottile, lys.nikolaou, pablogsal, BTaskaya, hauntsaninja
2020-05-10 23:44:03mbussonn修改messageid: <1589154243.07.0.470353106947.issue40334@roundup.psfhosted.org>
2020-05-10 23:44:03mbussonn链接issue40334 messages
2020-05-10 23:44:02mbussonn创建