On 28/04/2020 16:52, Łukasz Langa wrote:
On behalf of the entire Python development community, and the currently serving
Python release team in particular, I’m pleased to announce the release of
Python 3.9.0a6. Get it here:
....
thanks for the release; I tried to reply in the dev list, but failed miserably.
Sorry for any noise.
I see this simple difference which broke some ancient code which works in
Python 3.8.2
$ python
Python 3.8.2 (default, Apr 8 2020, 14:31:25)
[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')
robin@minikat:~/devel/reportlab/REPOS/reportlab/tests
$ python39
Python 3.9.0a6 (default, Apr 29 2020, 07:46:29)
[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
robin@minikat:~/devel/reportlab/REPOS/reportlab/tests
$ python39 -X oldparser
Python 3.9.0a6 (default, Apr 29 2020, 07:46:29)
[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
so presumably there has been some parser / language change which renders and'\n' illegal. Is this a real syntax error or
an alpha issue? It looks like the tokenization has changed. Putting in the obvious spaces removes the syntax error.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list