[3.14] gh-132661: Disallow Template/str concatenation after PEP 750 spec update (#135996) (#136901)

Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
Lysandros Nikolaou 2025-07-21 17:34:54 +02:00 committed by GitHub
parent 0d87bb66d3
commit af8d1f56f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 2098 additions and 2134 deletions

View file

@ -4070,16 +4070,6 @@ codegen_template_str(compiler *c, expr_ty e)
}
else {
VISIT(c, expr, value);
Py_ssize_t j;
for (j = i + 1; j < value_count; j++) {
value = asdl_seq_GET(e->v.TemplateStr.values, j);
if (value->kind == Interpolation_kind) {
break;
}
VISIT(c, expr, value);
ADDOP_INPLACE(c, loc, Add);
}
i = j - 1;
stringslen++;
last_was_interpolation = 0;
}