10000 gh-124363: Treat debug expressions in f-string as raw strings by pablogsal · Pull Request #128399 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124363: Treat debug expressions in f-string as raw strings #128399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 22, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Parser/action_helpers.c
  • Loading branch information
pablogsal committed Jan 22, 2025
commit 13f4e21578f635b8f34b23b5211a769783b656e2
4 changes: 3 additions & 1 deletion Parser/action_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,9 @@ _PyPegen_joined_str(Parser *p, Token* a, asdl_expr_seq* expr, Token*b) {
expr_ty item = asdl_seq_GET(expr, i);

// This should correspond to a JoinedStr node of two elements
// created _PyPegen_formatted_value
// created _PyPegen_formatted_value. This situation can only be the result of
// a f-string debug expression where the first element is a constant with the text and the second
// a formatted value with the expression.
if (item->kind == JoinedStr_kind) {
asdl_expr_seq *values = item->v.JoinedStr.values;
if (asdl_seq_LEN(values) != 2) {
Expand Down
0