3 ms·
> In the .format() version, the formatting and the values are separate and that makes it more clear to see both the formatting and the values. It makes it hard
by IanCal 6y ago
> In the .format() version, the formatting and the values are separate and that makes it more clear to see both the formatting and the values.
It makes it harder to see which values actually go where though. I really dislike the separation.
- ju_sh 6y agoThank goodness we still have both ;)
- roelschroeven 6y ago> I really dislike the separation. That's obviously a pretty fundamental difference in point-of-view. And it looks like your point-of-view is shared by a large majority. "The reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw I try to be reasonable, so I guess I should try to come to terms with f-strings. In any case please don't depend on more progress.
- thaumasiotes 6y ago> It makes it harder to see which values actually go where though. You can name the variables in the format string and then pass the expressions as keyword parameters.
- aidos 6y agoYou can do that with f-strings too... but you don't need to because they're generally already clearer.