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.

Author BTaskaya
Recipients BTaskaya, benjamin.peterson, pablogsal
Date 2020-01-28.08:41:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1580200908.73.0.745179365649.issue39474@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-01-28 08:41:48BTaskayasetrecipients: + BTaskaya, benjamin.peterson, pablogsal
2020-01-28 08:41:48BTaskayasetmessageid: <1580200908.73.0.745179365649.issue39474@roundup.psfhosted.org>
2020-01-28 08:41:48BTaskayalinkissue39474 messages
2020-01-28 08:41:48BTaskayacreate