Could’ve been long ago
Could’ve been long ago
Posted Apr 22, 2025 7:11 UTC (Tue) by xi0n (guest, #138144)Parent article: Template strings accepted for Python 3.14
So, this is basically format_args!() from Rust, producing an inspectable object containing the format string and its arguments. Neat, and the applications are quite obvious.
Funnily enough, this isn’t really tied to f-strings, other than the fact that the existence of f”” literals mandates this to be a special literal, too. One could easily imagine str.formatargs function, that takes same params as str.format but returns a Template, to have been added even to Python 2.x.
