8000 Write the official `cpython` documentation for t-strings · Issue #2 · t-strings/help · GitHub
[go: up one dir, main page]

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

Write the official cpython documentation for t-strings #2

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

Comments

@koxudaxi
Copy link
Contributor

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

@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

Work that we need to do:

  • 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"?)

@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 :)

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
0