[$] Custom string formatters in Python

Post Syndicated from daroc original https://lwn.net/Articles/985346/

Python has had
formatted string literals
(f-strings), a syntactic shorthand for building
strings, since 2015. Recently, Jim Baker, Guido van Rossum, and Paul Everitt have
proposed

PEP 750
(“Tag Strings For Writing Domain-Specific Languages”) which would
generalize and expand that mechanism to provide Python library writers with additional
flexibility. Reactions to the proposed change were somewhat positive, although
there was a good deal of discussion of (and opposition to)
the PEP’s inclusion of lazy evaluation of template parameters.