Message360844
Python 3.9.0a2+ (heads/master:65ecc390c1, Jan 26 2020, 15:39:11)
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ast
>>> source = "(2+2).source"
>>> ast.get_source_segment(source, ast.parse(source).body[0].value)
'2+2).source'
>>> source = "(2+2)[1]"
>>> ast.get_source_segment(source, ast.parse(source).body[0].value)
'2+2)[1]'
I can prepare a patch to extend attribute's col_offset into parens if it is any if approved. |
|
Date |
User |
Action |
Args |
2020-01-28 08:41:48 | BTaskaya | set | recipients:
+ BTaskaya, benjamin.peterson, pablogsal |
2020-01-28 08:41:48 | BTaskaya | set | messageid: <1580200908.73.0.745179365649.issue39474@roundup.psfhosted.org> |
2020-01-28 08:41:48 | BTaskaya | link | issue39474 messages |
2020-01-28 08:41:48 | BTaskaya | create | |
|