GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-132661: Implement PEP 750 by lysnikolaou · Pull Request #132662 · python/cpython

Conversation

@lysnikolaou

@lysnikolaou lysnikolaou commented Apr 17, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PEP 750 implementation! 🎉

Let's make sure as many people as possible take a look at this, since it's touching many areas that I've not worked on before.

  • Issue: Implement PEP 750 – Template Strings #132661

📚 Documentation preview 📚: https://cpython-previews--132662.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vasily-v-ryabov reacted with thumbs up emoji AA-Turner, efimov-mikhail, hugovk, Object905, vitaldmit, agriyakhetarpal, nineteendo, erlend-aasland, and johnslavik reacted with hooray emoji AA-Turner, erlend-aasland, and johnslavik reacted with heart emoji gitgernit, Wingysam, erlend-aasland, and johnslavik reacted with rocket emoji
All reactions
  • 👍 1 reaction
  • 🎉 9 reactions
  • ❤️ 3 reactions
  • 🚀 4 reactions
lysnikolaou and others added 30 commits October 18, 2024 17:41
@lysnikolaou
Implement next version of PEP 750
9248287
Still buggy
@lysnikolaou
First fixes; conv and format_spec still not working
450d771
@lysnikolaou
Change BUILD_INTERPOLATION opcode to simplify
a095a9b
@lysnikolaou
Add templatelib module & clean-up types/objects etc.
499d70c
@lysnikolaou
Support explicit concatenation of template and str
f742d45
@lysnikolaou
Avoid folding one node template into its content
0dda3f9
@lysnikolaou
Implement __eq__ for template and interpolation
17014e7
@lysnikolaou
Fix debug specifier segfault
94371bd
@lysnikolaou
Add __match_args__ to Interpolation
99184cc
@lysnikolaou
Fix syntax error prefix in t-strings
4e89c87
@lysnikolaou
Fix test_dis
6bfb095
@lysnikolaou
Fix test_fstring
560e957
@lysnikolaou
Fix test_embed
4d172c2
@lysnikolaou
Implement interleaving, hash functions and *args __init__
c9362e3
@lysnikolaou
Use Argument Clinic for interpolation_new
d2bd673
@lysnikolaou
Revert to using different grammar rules for tstring due to format_spec
7ae1b60
@lysnikolaou
Fix code generation for when there's many values in tstring
5e7304f
@lysnikolaou
Remove duplicate parens from template repr
c8f22f0
@lysnikolaou
Fix conversion converter for interpolation __new__
b0dbe27
@lysnikolaou
Merge branch 'main' into tstrings
b07c419
@lysnikolaou
Fix test_embed and test_dis -- again
3e84771
@lysnikolaou
Implement implicit concatenation with TemplateStr
9380ab9
@lysnikolaou
Merge branch 'main' into tstrings
22f9dc6
@lysnikolaou
Implement new specification of template type
f207637
@lysnikolaou
Replace nb_add with sq_concat
29b1386
@lysnikolaou
Correctly implement str + tstring
aad5d67
@Wingysam
Make changes requested by Steering Council (#57)
77822be
* Rename expr to expression, conv to conversion
* Move templatelib under string lib
* Add strings lib to LIBSUBDIRS
* Update type of Template/TemplateIter/Interpolation
@lysnikolaou
Merge branch 'main' into tstrings
f3ba0fe
@koxudaxi @lysnikolaou
Remove unnecessary _Py_TPFLAGS_MATCH_SELF from Template type (#60)
422a515
@koxudaxi @lysnikolaou
Fix memory leak in template concat error handling (#59)
bb7359a
Co-authored-by: Lysandros Nikolaou <[email protected]>
@sobolevn

sobolevn commented Apr 28, 2025

Copy link
Copy Markdown
Member

Oh, I messed up, sorry. I clicked "merge main", but it was a long process :(

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou

lysnikolaou commented Apr 28, 2025

Copy link
Copy Markdown
Member Author

Oops, I was too late. 😆

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

picnixz
picnixz approved these changes Apr 28, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One question and LGTM.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Objects/interpolationobject.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Eclips4
Eclips4 approved these changes Apr 28, 2025
View reviewed changes
markshannon
markshannon requested changes Apr 29, 2025
View reviewed changes

@markshannon markshannon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm not convinced about adding string/templatelib.py instead of adding the new types to types.
Either way, the C module is unnecessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Modules/_templatelibmodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/string/templatelib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/string/templatelib.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 29, 2025
@bedevere-app

bedevere-app Bot commented Apr 29, 2025

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting changes label Apr 29, 2025
@lysnikolaou
Remove _templatelib extension
ab9026f
@lysnikolaou
lysnikolaou force-pushed the tstrings branch from cc14116 to ab9026f Compare April 29, 2025 08:47
lysnikolaou added 2 commits April 29, 2025 11:05
@lysnikolaou
Change __reduce__ flags to METH_NOARGS
48f771b
@lysnikolaou
Merge branch 'main' into tstrings
0b1aef9
@lysnikolaou

lysnikolaou commented Apr 29, 2025

Copy link
Copy Markdown
Member Author

@markshannon Thanks for the review! I've removed the _templatelib extension.

Regarding the types vs string.templatelib discussion, I don't have a strong opinion either way, but it feels that it's too late for it to be reopened. The SC made their decision and I think we should go with it. We're a week away from the beta freeze and I'd like to get this PR in.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn

sobolevn commented Apr 29, 2025

Copy link
Copy Markdown
Member

In my humble opinion we should not add to types what we can add to some other semantically named module.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lysnikolaou lysnikolaou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2025
@bedevere-bot

bedevere-bot commented Apr 29, 2025

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @lysnikolaou for commit 0b1aef9 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F132662%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Apr 29, 2025
@markshannon

markshannon commented Apr 29, 2025

Copy link
Copy Markdown
Member

@markshannon Thanks for the review! I've removed the _templatelib extension.

Regarding the types vs string.templatelib discussion, I don't have a strong opinion either way, but it feels that it's too late for it to be reopened. The SC made their decision and I think we should go with it. We're a week away from the beta freeze and I'd like to get this PR in.

I'm fine with you merging this now. It is only a small change to move the code to types.py in another PR if that's what we decide we want.

lysnikolaou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@markshannon
markshannon self-requested a review April 29, 2025 17:18
markshannon
markshannon approved these changes Apr 29, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting changes labels Apr 29, 2025
dylwil3
dylwil3 reviewed Apr 29, 2025
View reviewed changes
Comment thread Doc/library/token.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

lysnikolaou added 3 commits April 30, 2025 10:14
@lysnikolaou
Fix docs for TSTRING_MIDDLE
8b0c132
@lysnikolaou
Merge branch 'main' into tstrings
b35ba13
@lysnikolaou
Fix ERROR_IF
44749c7
@lysnikolaou
lysnikolaou merged commit 6020260 into python:main Apr 30, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 30, 2025
@dvarrazzo dvarrazzo mentioned this pull request May 1, 2025
PEP 750: danger with explicit concatenation python/steering-council#289
Closed
@tconley1428 tconley1428 mentioned this pull request Oct 16, 2025
Linecache updatecache can perform many useless os calls #140228
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra JelleZijlstra left review comments
@StanFromIreland StanFromIreland StanFromIreland left review comments
@hugovk hugovk hugovk approved these changes
@sobolevn sobolevn sobolevn approved these changes
@AA-Turner AA-Turner AA-Turner approved these changes
@markshannon markshannon markshannon approved these changes
@picnixz picnixz picnixz approved these changes
@pablogsal pablogsal pablogsal approved these changes
@brandtbucher brandtbucher brandtbucher approved these changes
@ZeroIntensity ZeroIntensity ZeroIntensity approved these changes
@Eclips4 Eclips4 Eclips4 approved these changes
@isidentical isidentical Awaiting requested review from isidentical isidentical is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@iritkatriel iritkatriel Awaiting requested review from iritkatriel iritkatriel is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@corona10 corona10 Awaiting requested review from corona10
@AlexWaygood AlexWaygood Awaiting requested review from AlexWaygood AlexWaygood is a code owner
@ezio-melotti ezio-melotti Awaiting requested review from ezio-melotti ezio-melotti is a code owner
+2 more reviewers
@vasily-v-ryabov vasily-v-ryabov vasily-v-ryabov left review comments
@dylwil3 dylwil3 dylwil3 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

20 participants

@lysnikolaou @Wingysam @hugovk @bedevere-bot @sobolevn @AA-Turner @ZeroIntensity @markshannon @JelleZijlstra @vasily-v-ryabov @picnixz @pablogsal @brandtbucher @dylwil3 @Eclips4 @StanFromIreland @koxudaxi @davepeck @terryjreedy @pauleveritt
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.