New submission from Claudiu Popa:

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.

----------
components: Library (Lib)
messages: 250790
nosy: Claudiu.Popa
priority: normal
severity: normal
status: open
title: The AST for dict and set displays has the lineno of the first value
type: behavior
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25131>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to