[New-bugs-announce] [issue41064] IDLE highlights wrong place when code has syntax error of ** unpacking dict in f-string

JNCressey report at bugs.python.org
Sun Jun 21 08:32:38 EDT 2020


New submission from JNCressey <J_N_Cressey at live.co.uk>:

Compare f"{*my_tuple}" with f"{**my_dict}".
Both are syntax errors since you can't use unpacking here, but the bug is as follows:

- For the tuple, IDLE highlights the asterisk and has the helpful message 'SyntaxError: can't use starred expression here',

- But for the dictionary, the first few characters of your code are highlighted, regardless of where the syntax error is located, and the message only says 'SyntaxError: invalid syntax'.

Bug occurs in both 3.8.3 and 3.7.7, I haven't tested it in 3.6 nor in-development versions.

----------
assignee: terry.reedy
components: IDLE
messages: 371995
nosy: JNCressey, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE highlights wrong place when code has syntax error of ** unpacking dict in f-string
type: compile error
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41064>
_______________________________________


More information about the New-bugs-announce mailing list