3 ms·
The changes to f-strings just seems like a step in the wrong direction. Don't make the string content implicit!
by ProjectBarks 7y ago
The changes to f-strings just seems like a step in the wrong direction. Don't make the string content implicit!
- strictfp 7y agoAlso, why abandon printf-style? All languages tend to converge to printf over time, it's simply the most tried and tested model out there!
- baq 7y agohttps://pyformat.info/ https://pyformat.info/
- joshuamorton 7y agojavascript, python, rust, etc. don't use printf style, but instead use the {} style.
- strictfp 7y agoYeah, well Rust isn't exactly a success story in that regard if you ask me. A couple of weeks ago I tried to figure out how to format a float properly in Rust, and the way they made it work is a lot worse than straight up printf-style if you ask me.
- bvrmn 7y agoFormat string is very inconvenient approach because you need to duplicate type information. >>> '%i' % 's' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: %i format: a number is required, not str >>> '{}'.format('s') 's' >>> '{}'.format(10) '10'