Skip to content

Conversation

@davepeck
Copy link
Contributor

@davepeck davepeck commented Jun 26, 2025

Following the steering council decision and corresponding update to PEP750, we are removing support for both implicit and explicit Template/str concatenation.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@lysnikolaou
Copy link
Member

Happy to do this with your input, or happy to hand it off to you!

Happy to help out / review this PR if you wanna take a stab at it. Feel free to reach out if you have any specific questions.

@davepeck davepeck marked this pull request as ready for review July 8, 2025 23:27
@davepeck
Copy link
Contributor Author

davepeck commented Jul 8, 2025

@lysnikolaou Think this is ready. The only question for me is whether we want to go further with _PyPegen_concatenate_strings().

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Several small nitpicks :)

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @davepeck for working on this! Looks great in general. Left a few unimportant comments and one more significant one about how to implement this in the parser. Also, we'll need to change ast_unparse.c around https://github.com/python/cpython/blob/main/Python/ast_unparse.c#L715.

@efimov-mikhail
Copy link
Member

LGTM

@lysnikolaou
Copy link
Member

Looks great and aaalmost there. I have one last thing I missed during my previous reviews.

If I remember correctly, https://github.com/python/cpython/blob/main/Python/codegen.c#L4084-L4093 can be removed as well, because it's only there to handle FormattedValues, which cannot happen anymore.

After that, it's gonna be good to go, promise!

@davepeck
Copy link
Contributor Author

davepeck commented Jul 17, 2025

If I remember correctly, https://github.com/python/cpython/blob/main/Python/codegen.c#L4084-L4093 can be removed as well, because it's only there to handle FormattedValues, which cannot happen anymore.

@lysnikolaou Ah, yes -- thank you. Removed now; tests continue to pass.

(If we prefer, I can replace VISIT() in the else block with a direct ADDOP_LOAD_CONST(). I'd probably add an assert(value->kind == Constant_kind) there, too.)

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks @davepeck! Great work.

@lysnikolaou lysnikolaou added the needs backport to 3.14 bugs and security fixes label Jul 21, 2025
@lysnikolaou lysnikolaou merged commit c5e77af into python:main Jul 21, 2025
46 of 47 checks passed
@miss-islington-app
Copy link

Thanks @davepeck for the PR, and @lysnikolaou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@lysnikolaou lysnikolaou deleted the pep750-concat-update branch July 21, 2025 06:44
@miss-islington-app
Copy link

Sorry, @davepeck and @lysnikolaou, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker c5e77af131aa0c8832a9ee50c4410731254e4209 3.14

@lysnikolaou
Copy link
Member

I can handle tha backport.

@serhiy-storchaka
Copy link
Member

Reminder about backporting. @davepeck @lysnikolaou

@encukou
Copy link
Member

encukou commented Aug 15, 2025

GH-136901 is a backport of this pull request to the 3.14 branch.

@encukou encukou removed the needs backport to 3.14 bugs and security fixes label Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants