Skip to content

gh-132661: Document t-strings and templatelib #135229

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

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

davepeck
Copy link
Contributor

@davepeck davepeck commented Jun 6, 2025

[DRAFT] This has only just begun and is very much a work in progress; putting up a draft PR now for visibility.

We're keeping a TODO list of PEP 750 documentation tasks. There's lots to do.


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

@davepeck
Copy link
Contributor Author

@hugovk Thank you for the review and the helpful early feedback! Useful to know about linking.

(FWIW this is very early stage still, so I expect plenty more linting and other issues that we'll eventually resolve.)

@@ -1044,7 +1082,7 @@ readability::

Either of these parts, but not both, can be empty. For example::

10. # (equivalent to 10.0)
1. # (equivalent to 10.0)
Copy link
Member

@encukou encukou Jun 27, 2025

Choose a reason for hiding this comment

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

This is incorrect (and unrelated).

Suggested change
1. # (equivalent to 10.0)
10. # (equivalent to 10.0)

t-string
String literals prefixed with ``'t'`` or ``'T'`` are commonly called
"t-strings" which is short for
:ref:`template string literals <t-strings>`. See also :pep:`750`.
Copy link
Member

Choose a reason for hiding this comment

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

The PEP is the original change proposal, and it's expected to go go out of date. It's good to have a link to it in the docs (e.g. a “see also” in the main docs for the feature), so people can read the motivation and get at the discussion links, but if there's any other info in the PEP that's relevant to readers, it should go in the docs.

Suggested change
:ref:`template string literals <t-strings>`. See also :pep:`750`.
:ref:`template string literals <t-strings>`.

(And yes, the current docs aren't too great at this.)

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

Successfully merging this pull request may close these issues.

4 participants