Skip to content

Write the official cpython documentation for t-strings #2

Open
@koxudaxi

Description

@koxudaxi

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
  • Add new t-string roles to lexical-analysis.rst section with the _f-strings role and make sure it covers t-strings appropriately.
  • 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
  • Lexical analysis, adjust String and Bytes literals section (Pending changes in this PR by @encukou .)
  • Update the Template strings section of Doc/library/string.rst to clarify that this is unrelated to t-strings (it's $-strings)
  • A section after the f-strings part of the tutorial where perhaps we show writing a function. I'm 50-50 on this (the cookbook might be enough.)

This can be a follow-on PR, but probably shouldn't be part of the first PR?:

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions