4 ms·
Having not written Python in a long time until recently, I discovered fstrings. Are they the best choice for (nearly all) string formatting at least in new code
by andrewem 6y ago
Having not written Python in a long time until recently, I discovered fstrings. Are they the best choice for (nearly all) string formatting at least in new code? They seem to work pretty similarly to eg Ruby’s string interpolation.
- pythonslayer 6y agoYes. I’m not sure about speed, but syntactically they are far superior and better for all cases, unless of course you’re wanting to pass templates as an input, but that’s pretty obvious.