[RELEASE] Python 3.9.0a6 is now available for testing

Schachner, Joseph Joseph.Schachner at Teledyne.com
Wed Apr 29 15:23:42 EDT 2020


>     norm=lambda m: m+(m and(m[-1]!= '\n'and'\n'or'  ')or'\n')
Parentheses                       1          2                                        1         0                       
quotes                                                             1  0     1   0   1 0    1  0  

OK I don't see any violation of quoting or parentheses matching.   Still trying to figure out what this lambda does.

--- Joseph S.
 
-----Original Message-----
From: Robin Becker <robin at reportlab.com> 
Sent: Wednesday, April 29, 2020 10:52 AM
To: Łukasz Langa <lukasz at langa.pl>; python-list at python.org; python-announce at python.org
Subject: Re: [RELEASE] Python 3.9.0a6 is now available for testing

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