3 ms·
imakesnowflakes made a good point below. Also compare the readability of this: "very long text {value} another long text".\ format(value=value) vs. f"very l
by yedpodtrzitko 11y ago
imakesnowflakes made a good point below.
Also compare the readability of this:
"very long text {value} another long text".\
format(value=value)
vs.
f"very long text {value} another long text"
^ now you have to go and visually search through the whole string to see what is being used in there
- TazeTSchnitzel 11y agoSyntax highlighting will make the variables used in the string pop out. This is easier than scanning to the end of the line to find the format() call.
- sanderjd 11y agoThis isn't a bad point, but anecdotally, after using interpolated strings for many years, I've never come across this problem a single time.