msg294408 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2017-05-24 22:53 |
f-strings are computed in a separate compiler step. This makes their lineno and col_offset information wrong. This is problematic for flake8 which reports problems inside f-strings on the wrong line (typically the first one). Attached patch fixes the issue. |
|
|
msg294423 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2017-05-25 01:34 |
Thanks for adding so many tests. |
|
|
msg294866 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2017-05-31 18:58 |
I have concerns about following cases. * f-string containing multiple equivalent subexpressions: f'{x} {x}' or f''' {x} {x} ''' * f-string containing escaped newlines: f'''\ \ {x}\ \ ''' The tests look slightly verbose and fragile to me. If once the parser will produce more efficient tree (see ), the tests may fail. Needed more tests (for cases mentioned above), and adding them will add more verbose code. Maybe just find the child (or several children) of specific type and check lineno and col_offset only for it and few its children? If this will make the tests simpler. But if tests can't be made simpler, we should live with this. |
|
|
msg301368 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2017-09-05 20:37 |
See also issue 31140: I'm not sure if that case is covered by this issue. |
|
|
msg301551 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2017-09-07 00:28 |
New changeset e7c566caf177afe43b57f0b2723e723d880368e8 by ericvsmith (Łukasz Langa) in branch 'master': bpo-30465: Fix lineno and col_offset in fstring AST nodes (#1800) https://github.com/python/cpython/commit/e7c566caf177afe43b57f0b2723e723d880368e8 |
|
|
msg301563 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2017-09-07 02:43 |
New changeset aa1afc72c1ee1f090e6302198d9a0295f1ce1c05 by ericvsmith (Miss Islington (bot)) in branch '3.6': bpo-30465: Fix lineno and col_offset in fstring AST nodes (GH-1800) (gh-3409) https://github.com/python/cpython/commit/aa1afc72c1ee1f090e6302198d9a0295f1ce1c05 |
|
|
msg303571 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2017-10-02 23:58 |
Is there more to do on this issue or can it be closed now? |
|
|
msg303680 - (view) |
Author: Eric V. Smith (eric.smith) *  |
Date: 2017-10-04 12:08 |
I think it's fixed. Closing. |
|
|
msg315971 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2018-04-30 21:51 |
New changeset fb7e7992beec7f76cc2db77ab6ce1e86446bfccf by Łukasz Langa (Victor Stinner) in branch 'master': bpo-30465: Fix C downcast warning on Windows in ast.c (#6593) https://github.com/python/cpython/commit/fb7e7992beec7f76cc2db77ab6ce1e86446bfccf |
|
|
msg340699 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2019-04-23 08:26 |
New changeset 8a9a6b443c57e47e9d10ed7775479aada4dac719 by Victor Stinner in branch '3.7': [3.7] bpo-9566: Fix compiler warnings on Windows (GH-12920) https://github.com/python/cpython/commit/8a9a6b443c57e47e9d10ed7775479aada4dac719 |
|
|