~/talk

Uncovering the magic of implementing a new Python syntax feature

links:none on file
slides:none on file

PEP 750 T-strings are implemented in CPython end-to-end: the handwritten tokenizer recognizes t-string-start / t-string-middle / t-string-end tokens, the generated parser uses grammar actions and memo flags to emit AST nodes like TemplateString → Interpolation(Name id, Constant), the bytecode compiler emits instructions such as load_const, load_name, build_interpolation and build_template bytecode, and the stack‑based interpreter executes them. The implementation runs in Python 3.14, includes a simple optimization collapsing two load_consts + build_tuple into one load_const tuple, and produces the new template type correctly.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:44What are T-strings
  3. 5:20Syntax features in Python
  4. 7:54Tokenizer and token stream
  5. 11:34Parser and AST construction
  6. 19:00Bytecode compiler process
  7. 24:02Python interpreter execution
  8. 27:48Recap and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.