Python f-strings are the best syntax sugar i never knew about
I've written `"text {foo}".format(foo=foo)` so many times I've almost convinced myself that it's not that verbose. Then i discovered fstrings introduced ins 3.6:
```
>>> f"text {fpp}"
'text foo'
```
>>> mind == blown
True
13 comments
[ 3.7 ms ] story [ 41.5 ms ] threadIt's much nicer to write this:
f"{account_name} {pretty_date(start_date)} - {pretty_date(end_date)} account attribution"
and MUCH easier to maintain than the alternative...!
I get the same feeling as well, and it's something I noticed a lot when it was a new feature to C#. Suddenly, everyone abandoned string.Format() in favour of $"", even when the code would lose a lot of readability.
Syntactic sugar is good and all, but I find it better to be more verbose for the sake of clarity.
When you just want to interpolate a string on the fly, Fstrings are absolutely the right thing to do most of the time.
https://cito.github.io/blog/f-strings/