[RELEASE] Python 3.9.0a6 is now available for testing
Robin Becker
robin at reportlab.com
Wed Apr 29 10:51:37 EDT 2020
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 at 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 at 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
More information about the Python-list
mailing list