Skip to content

Commit 24668df

Browse files
committed
Rephrase after CR
1 parent a2ad759 commit 24668df

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Lib/test/test_grammar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ def test_warn_missed_comma(self):
15251525
def check(test):
15261526
self.check_syntax_warning(test, msg)
15271527

1528-
msg=r'is not callable; did you miss a comma to separate sequence elements\?'
1528+
msg=r'is not callable; did you miss a comma to separate elements\?'
15291529
check('[(1, 2) (3, 4)]')
15301530
check('[(x, y) (3, 4)]')
15311531
check('[[1, 2] (3, 4)]')
@@ -1548,7 +1548,7 @@ def check(test):
15481548
check('[t"{x}" (3, 4)]')
15491549
check('[t"x={x}" (3, 4)]')
15501550

1551-
msg=r'is not subscriptable; did you miss a comma to separate sequence elements\?'
1551+
msg=r'is not subscriptable; did you miss a comma to separate elements\?'
15521552
check('[{1, 2} [i, j]]')
15531553
check('[{i for i in range(5)} [i, j]]')
15541554
check('[(i for i in range(5)) [i, j]]')
@@ -1562,7 +1562,7 @@ def check(test):
15621562
check('[t"{x}" [i, j]]')
15631563
check('[t"x={x}" [i, j]]')
15641564

1565-
msg=r'indices must be integers or slices, not tuple; did you miss a comma to separate sequence elements\?'
1565+
msg=r'indices must be integers or slices, not tuple; did you miss a comma to separate elements\?'
15661566
check('[(1, 2) [i, j]]')
15671567
check('[(x, y) [i, j]]')
15681568
check('[[1, 2] [i, j]]')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Improve syntax warning messages for missing commas in sequences. The messages now say "did you miss a comma to separate sequence elements?" instead of "perhaps you missed a comma?".
1+
Improve the suggestion in syntax warning messages for potentially missing commas when defining containers. The messages now say "did you miss a comma to separate elements?" instead of "perhaps you missed a comma?".

Python/codegen.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,7 +3673,7 @@ check_caller(compiler *c, expr_ty e)
36733673
case Interpolation_kind: {
36743674
location loc = LOC(e);
36753675
return _PyCompile_Warn(c, loc, "'%.200s' object is not callable; "
3676-
"did you miss a comma to separate sequence elements?",
3676+
"did you miss a comma to separate elements?",
36773677
infer_type(e)->tp_name);
36783678
}
36793679
default:
@@ -3704,7 +3704,7 @@ check_subscripter(compiler *c, expr_ty e)
37043704
case Lambda_kind: {
37053705
location loc = LOC(e);
37063706
return _PyCompile_Warn(c, loc, "'%.200s' object is not subscriptable; "
3707-
"did you miss a comma to separate sequence elements?",
3707+
"did you miss a comma to separate elements?",
37083708
infer_type(e)->tp_name);
37093709
}
37103710
default:
@@ -3739,7 +3739,7 @@ check_index(compiler *c, expr_ty e, expr_ty s)
37393739
location loc = LOC(e);
37403740
return _PyCompile_Warn(c, loc, "%.200s indices must be integers "
37413741
"or slices, not %.200s; "
3742-
"did you miss a comma to separate sequence elements?",
3742+
"did you miss a comma to separate elements?",
37433743
infer_type(e)->tp_name,
37443744
index_type->tp_name);
37453745
}

0 commit comments

Comments
 (0)