Author Claudiu.Popa
Recipients Claudiu.Popa
Date 2015-09-15.18:28:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442341705.94.0.0242549644551.issue25131@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-09-15 18:28:25Claudiu.Popasetrecipients: + Claudiu.Popa
2015-09-15 18:28:25Claudiu.Popasetmessageid: <1442341705.94.0.0242549644551.issue25131@psf.upfronthosting.co.za>
2015-09-15 18:28:25Claudiu.Popalinkissue25131 messages
2015-09-15 18:28:25Claudiu.Popacreate