]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-31241: Fix AST node position for list and generator comprehensions. (GH-10633)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 27 Nov 2018 07:40:29 +0000 (09:40 +0200)
committerGitHub <noreply@github.com>
Tue, 27 Nov 2018 07:40:29 +0000 (09:40 +0200)
commitb619b097923155a7034c05c4018bf06af9f994d0
treea9f0f2a6c1b2ef8ceccd02f18612e43dd5689420
parentd1cbc6f8a00cf881ced6238c5e652054e8fdc30f
bpo-31241: Fix AST node position for list and generator comprehensions. (GH-10633)

The lineno and col_offset attributes of AST nodes for list comprehensions,
generator expressions and tuples are now point to the opening parenthesis or
square brace. For tuples without parenthesis they point to the position
of the first item.
Lib/test/test_ast.py
Lib/test/test_exceptions.py
Misc/NEWS.d/next/Core and Builtins/2018-11-21-14-05-51.bpo-31241.Kin10-.rst [new file with mode: 0644]
Python/ast.c
Python/importlib_zipimport.h