On 4/30/2021 11:07 PM, Mike Lee Williams wrote:
On Friday, April 30, 2021 at 7:55:10 PM UTC-7, Mike Lee Williams wrote:
This trivial bit of code is parsed differently by the ast module between python
3.7 and python 3.8. I'm trying to figure out what changed and why, and once I
know that, if it's possible and desirable to retain the 3.7 behavior for my use
case (which needs to give the same result for this input on 3.7 and 3.8).

Answering my own question: the behavior was changed by 
https://github.com/python/cpython/pull/9731.

Since this patch, Mark Shannon has revised line numbering and tracing and replaced the internal lineno data structure. Your example code still outputs 2. So Mark either missed this case or considers it correct.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to