Skip to content

Write the official cpython documentation for t-strings #2

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
10 tasks
koxudaxi opened this issue May 17, 2025 · 8 comments
Open
10 tasks

Write the official cpython documentation for t-strings #2

koxudaxi opened this issue May 17, 2025 · 8 comments
Assignees

Comments

@koxudaxi
Copy link
Contributor

koxudaxi commented May 17, 2025

We should write the offical document for https://docs.python.org/3/library/

  • Document string.templatelib in the Library reference section
  • Find all mentions of f-strings in the current documentation and decide whether there should also be a reference to t-strings
  • Add AST nodes to the ast docs
  • Glossary
  • Lexical analysis, adjust String and Bytes literals section
  • Lexical analysis, adjust f-strings section (probably keep one section and talk about f-string and t-string syntax in it, since it's so closely tied)
  • Add BUILD_INTERPOLATION and BUILD_TEMPLATE to the dis docs, probably somewhere near BUILD_TUPLE
  • Consider building a "Python string formatting cookbook" that explains when you might use each of Python's increasingly many formatting features. (One question we got asked a lot at PyCon was: "are f-strings deprecated"?)
  • Update the Template strings section of Doc/library/string.rst to clarify that this is unrelated to t-strings (it's $-strings)
  • Add new t-string roles to lexical-analysis.rst section with the _f-strings role and make sure it covers t-strings appropriately.
@koxudaxi koxudaxi changed the title Write t-strings offical document. Write t-strings offical document for docs.python.org/3/library May 17, 2025
@davepeck davepeck changed the title Write t-strings offical document for docs.python.org/3/library Write official cpython documentation for t-strings May 19, 2025
@davepeck
Copy link
Contributor

davepeck commented May 19, 2025

Obsoleted all of these, moved to issue body.

@lysnikolaou @AA-Turner would also love your input here.

@davepeck davepeck changed the title Write official cpython documentation for t-strings Write the official cpython documentation for t-strings May 19, 2025
@davepeck davepeck self-assigned this May 19, 2025
@lysnikolaou
Copy link

During the PyCon sprints, we edited @davepeck's comment above to include more places that need to be adjusted.

A couple of comments:

Find all mentions of f-strings in the current documentation and decide whether there should also be a reference to t-strings

Agreed that we should try and change some places where f-strings are mentioned (some are listed below this bullet point). To be honest, I wouldn't give that much emphasis to adjusting all the occurences. It's perfectly fine for places in the docs to talk about f-strings without mentioning t-strings.

Consider building a "Python string formatting cookbook" that explains when you might use each of Python's increasingly many formatting features. (One question we got asked a lot at PyCon was: "are f-strings deprecated"?)

I agree that a "cookbook" is a good idea. We could probably add a "t-strings HOWTO" in the section with all the HOWTOs.

@blaisep
Copy link

blaisep commented May 29, 2025

cross-posting a related thread from the mothership: https://discuss.python.org/t/t-stringd-doc-pep-750-and-amish-barn-raising/93654

@encukou
Copy link

encukou commented May 29, 2025

Dibs on Lexical analysis, then!

If y'all have some work in progress in any state, please share by Wednesday -- my bigger aim is to improve string literal docs in general, so it'll conflict :)

@davepeck
Copy link
Contributor

davepeck commented Jun 5, 2025

More TODOs added

@davepeck
Copy link
Contributor

davepeck commented Jun 6, 2025

Documentation is starting to collect at https://github.com/t-strings/cpython/tree/docs/pep750-templatelib

@lysnikolaou
Copy link

I wouldn't hold back on opening upstream PRs as well, once things get in shape, so that we can iterate with other documentarians as well.

@davepeck
Copy link
Contributor

davepeck commented Jun 6, 2025

I wouldn't hold back on opening upstream PRs as well, once things get in shape, so that we can iterate with other documentarians as well.

Just opened one! (update: just opened one based to the right branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

5 participants