This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python3.9 changes col_offset for some ast nodes
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, hauntsaninja, pablogsal, serhiy.storchaka
Priority: normal Keywords:

Created on 2020-04-21 03:58 by hauntsaninja, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg366909 - (view) Author: Shantanu (hauntsaninja) * Date: 2020-04-21 03:58
With Python 3.8:
```
Python 3.8.1 (default, Jan 23 2020, 23:36:06) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.parse("(a).x").body[0].value.col_offset
1
```

With Python 3.9:
```
Python 3.9.0a5+ (heads/master:799d7d6, Apr  6 2020, 16:05:37) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> ast.parse("(a).x").body[0].value.col_offset
0
```

Maybe related to the new parser? I couldn't find what the environment variable to turn it off was.

For context, I'm trying to get mypy tests to pass with 3.9, but the tests make use of specific col_offsets for error reporting. It would be nice if these continued to match with 3.9
msg366910 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-21 06:43
col_offset = 0 is the correct value. There was a bug which is fixed now (see issue39474).
History
Date User Action Args
2022-04-11 14:59:29adminsetgithub: 84529
2020-04-21 06:43:12serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg366910

resolution: not a bug
stage: resolved
2020-04-21 04:05:13xtreaksetnosy: + pablogsal, BTaskaya
2020-04-21 03:58:08hauntsaninjacreate