
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2015-09-15 18:28 byClaudiu.Popa, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Messages (4) | |||
|---|---|---|---|
| msg250790 -(view) | Author: PCManticore (Claudiu.Popa)*![]() | Date: 2015-09-15 18:28 | |
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. | |||
| msg250793 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2015-09-15 18:47 | |
Using hg bisect, I found the revisiona65f685ba8c0: changeset: 95886:a65f685ba8c0user: Benjamin Peterson <benjamin@python.org>date: Tue May 05 20:16:41 2015 -0400files:Grammar/GrammarInclude/Python-ast.hInclude/dictobject.hInclude/opcode.hLib/importlib/_bootstrap_external.pyLib/opcode.pyLib/test/test_ast.pyLib/test/test_extcall.pyLib/test/test_grammar.pyLib/test/test_parser.pyLib/test/test_syntax.pyLib/test/test_unpack_ex.pyMisc/ACKSMisc/NEWSModules/parsermodule.cObjects/dictobject.cParser/Python.asdlPython/Python-ast.cPython/ast.cPython/ceval.cPython/compile.cPython/graminit.cPython/importlib_external.hPython/opcode_targets.hPython/symtable.cTools/parser/unparse.pydescription:PEP 448: additional unpacking generalizations (closes#2292)Patch by Neil Girdhar. | |||
| msg251041 -(view) | Author: Terry J. Reedy (terry.reedy)*![]() | Date: 2015-09-18 23:19 | |
A fix should include a new ast test, such as self.assertEqual(parse("{\n1:2}").body[0].value.lineno, 1)I verified that the equivalent assert passes on 3.4.3, fails on 3.5.0. | |||
| msg251636 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2015-09-26 05:46 | |
New changeset4f14afc959df by Benjamin Peterson in branch '3.5':make opening brace of container literals and comprehensions correspond to the line number and col offset of the AST node (closes#25131)https://hg.python.org/cpython/rev/4f14afc959dfNew changeset9d895c09c08a by Benjamin Peterson in branch 'default':merge 3.5 (#25131)https://hg.python.org/cpython/rev/9d895c09c08a | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:21 | admin | set | github: 69318 |
| 2015-09-26 05:46:24 | python-dev | set | status: open -> closed nosy: +python-dev messages: +msg251636 resolution: fixed stage: test needed -> resolved |
| 2015-09-23 11:09:41 | berker.peksag | set | keywords: +3.5regression |
| 2015-09-18 23:19:22 | terry.reedy | set | nosy: +terry.reedy messages: +msg251041 stage: test needed |
| 2015-09-15 18:52:17 | vstinner | set | nosy: +NeilGirdhar |
| 2015-09-15 18:47:00 | vstinner | set | nosy: +vstinner,benjamin.peterson messages: +msg250793 |
| 2015-09-15 18:28:25 | Claudiu.Popa | create | |