Decoratored functions parsed differently by ast stdlib between 3.7 and 3.8

Mike Lee Williams mjwilliams at gmail.com
Mon May 3 13:45:22 EDT 2021


On Monday, May 3, 2021 at 10:41:14 AM UTC-7, Terry Reedy wrote:
> > 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. 

Yes, reading through the correspondence it's clear that the view is that the old behavior was a bug and this change is a bugfix. I can work around this for my use case.


More information about the Python-list mailing list