Message250790
Hi,
In Python 3.5, the lineno for dict and set display ASTs is the line number of the first value, not the line number of the display character, as it was until 3.5. Here's an example:
from ast import parse
module = parse('''{
'1':'2',
}
''')
dict_display = module.body[0].value
print(dict_display.lineno)
I don't seem to find anything related to this in the documentation, but I presume this is a side effect of the new parser changes. It would nice to have this fixed or at least documented. |
|
Date |
User |
Action |
Args |
2015-09-15 18:28:25 | Claudiu.Popa | set | recipients:
+ Claudiu.Popa |
2015-09-15 18:28:25 | Claudiu.Popa | set | messageid: <1442341705.94.0.0242549644551.issue25131@psf.upfronthosting.co.za> |
2015-09-15 18:28:25 | Claudiu.Popa | link | issue25131 messages |
2015-09-15 18:28:25 | Claudiu.Popa | create | |
|