3 ms·
> String interpolation is one of those features 70% of these "wtfs" aren't about string interpolation but just python's syntax for string.format https://docs.
by almostgotcaught 1y ago
> String interpolation is one of those features
70% of these "wtfs" aren't about string interpolation but just python's syntax for string.format
https://docs.python.org/3/library/string.html#format-string-syntax https://docs.python.org/3/library/string.html#format-string-...
- zahlman 1y ago"String interpolation" is a term for the purpose that the string.format syntax serves.
- almostgotcaught 1y agono it's not - string interpolation means inlining values and such. format strings long predate string interpolation https://en.wikipedia.org/wiki/Printf https://en.wikipedia.org/wiki/Printf
- oasisaimlessly 1y agoPython 2.7 called its % operator the "string interpolation" operator[1], and it doesn't allow inline values. [1]: https://docs.python.org/2.7/library/stdtypes.html#string-formatting-operations https://docs.python.org/2.7/library/stdtypes.html#string-for...