New submission from Pablo Galindo Salgado <[email protected]>:
Currently the error for invalid dict literals is generic:
>>> {1:2, 3:}
File "<stdin>", line 1
{1:2, 3:}
^
SyntaxError: invalid syntax
>>> {1:2, 3}
File "<stdin>", line 1
{1:2, 3}
^
SyntaxError: invalid syntax
We can have better errors for these cases, which can help with big dict
literals:
>>> {1:2, 3}
File "<stdin>", line 1
{1:2, 3}
^
SyntaxError: ':' expected after dictionary key
>>> {1:2, 3:}
File "<stdin>", line 1
{1:2, 3:}
^
SyntaxError: expression expected after dictionary key and ':'
----------
messages: 390917
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Improve syntax errors for invalid dictionary literals
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43823>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com