Text Is Not Text: The History of Strings in Python
summary
Reviews the history and problems of C-style char* strings (buffer overflows and exploits) and how UTF-8 became dominant on the web; explains Unicode codepoints use up to 4 bytes and gives the concrete example that an emoji family can have length 7 due to zero-width joiners. Describes CPython’s PEP 393 “kind” optimization that reduced memory for strings, traces Python’s formatting evolution from % to f-strings to PEP 750 T-strings, and explains that T-strings keep template structure and bindings to enable deferred, safer SQL templating that can prevent injection.
AI-written summary · about
chapters (17)
- 0:00Python strings intro
- 2:46What strings measure
- 4:17Bits to characters Unicode
- 6:32Buffer overflows in C
- 8:02ASCII to Unicode challenges
- 9:40Encoding problems UTF-8
- 13:29Codepoints vs encodings
- 14:37Emoji is seven bytes
- 15:52Python 2 strings Unicode
- 17:55Python 3 Unicode Sandwich
- 19:45String formatting evolution
- 21:02From printf to f-strings
- 24:30F-strings advantages limits
- 26:29T-strings structure context
- 28:07T-strings vs SQL injection
- 30:42Summary string abstraction
- 32:00Q&A
related talks
25mDecoding the Frustrations and Vulnerabilities of Modern Text Processing
33mPython's Transition to Multilingual Programming
29mUncovering the magic of implementing a new Python syntax feature
25mWhy len 4 and other weird things you should know about strings in Python
24mWhy `len('😶🌫️') == 4` and other weird things you should know about strings in Python
28mIntroducing t-strings: f-strings with superpowers
27m"Disentangling formatted strings with T-strings"
24mF Strings!
