Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-135676: Lexical analysis: Reword String literals and related sections #135942

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

encukou
Copy link
Member

@encukou encukou commented Jun 25, 2025

Hopefully this PR is not too big. I can split it up if that would make it easier to review.

The f-string section is untouched here; a stub is added for t-strings. I'll look at those next.


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

Copy link
Contributor

@davepeck davepeck left a comment

Choose a reason for hiding this comment

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

Thanks! This was linked into the PEP 750 documentation TODO list so I took a look. I have one comment as it relates to t-strings; the rest of the changes are broader in scope, so I'll leave it to others to comment. (FWIW, I like the reorganization here!)

print(greeting + space + name) # not: print(greeting space name)

Also note that literal concatenation can freely mix raw strings,
triple-quoted strings, and formatted or template string literals.
Copy link
Contributor

Choose a reason for hiding this comment

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

Literal concatenation can freely mix raw strings, triple-quoted strings, and formatted or template string literals.

With the recent steering-council approved update to PEP 750, this is no longer true; Template/str concatenation of any form (including literal) is now prohibited.

.. _t-strings:
.. _template-string-literals:

t-strings
Copy link
Contributor

@davepeck davepeck Jun 27, 2025

Choose a reason for hiding this comment

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

(Thanks! Looks like we overlapped here; we have a t-string literal section in the draft PEP 750 documentation PR too. Easy merge, though.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants