Commit 4f4e72f
committed
Improve syntax warning hint for missing commas
Fixes #140764
Changed the cryptic 'perhaps you missed a comma?' hint to the
clearer 'did you miss a comma to separate sequence elements?'
This makes the warning's intention more obvious when code like
`[]()`, `1[2]`, or `[][] ` triggers a syntax warning.
Updated error messages in Python/codegen.c for:
- callable check
- subscriptable check
- index type check
Updated corresponding tests in Lib/test/test_grammar.py to match
the new warning text.1 parent b6b0e14 commit 4f4e72f
2 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1520 | 1520 | | |
1521 | 1521 | | |
1522 | 1522 | | |
1523 | | - | |
| 1523 | + | |
1524 | 1524 | | |
1525 | 1525 | | |
1526 | 1526 | | |
| |||
1543 | 1543 | | |
1544 | 1544 | | |
1545 | 1545 | | |
1546 | | - | |
| 1546 | + | |
1547 | 1547 | | |
1548 | 1548 | | |
1549 | 1549 | | |
| |||
1557 | 1557 | | |
1558 | 1558 | | |
1559 | 1559 | | |
1560 | | - | |
| 1560 | + | |
1561 | 1561 | | |
1562 | 1562 | | |
1563 | 1563 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3650 | 3650 | | |
3651 | 3651 | | |
3652 | 3652 | | |
3653 | | - | |
| 3653 | + | |
3654 | 3654 | | |
3655 | 3655 | | |
3656 | 3656 | | |
| |||
3681 | 3681 | | |
3682 | 3682 | | |
3683 | 3683 | | |
3684 | | - | |
| 3684 | + | |
3685 | 3685 | | |
3686 | 3686 | | |
3687 | 3687 | | |
| |||
3716 | 3716 | | |
3717 | 3717 | | |
3718 | 3718 | | |
3719 | | - | |
| 3719 | + | |
3720 | 3720 | | |
3721 | 3721 | | |
3722 | 3722 | | |
| |||
0 commit comments