Navigation
Search
|
A revamped Python string-formatting proposal
Wednesday January 22, 2025. 07:08 PM , from LWN.net
The proposal to add a more general facility for string formatting to
Python, which we looked at in August 2024, has changed a great deal since, so it merits another look. The changes take multiple forms: a new title for PEP 750 ('Template Strings'), a different mechanism for creating and using templates, a new Template type to hold them, and several additional authors for the PEP. Meanwhile, one controversial part of the original proposal, lazy evaluation of the interpolated values, has been changed so that it requires an explicit opt-in (via lambda); template strings are a generalization of f-strings and lazy evaluation was seen by some as a potentially confusing departure from their behavior.
https://lwn.net/Articles/1005000/
Related News |
25 sources
Current Date
Jan, Mon 27 - 20:33 CET
|