4 ms·
This is super minor but I really wish f-string formatting were the default behavior for `print` or that there were a `printf` command just for it. Typing that e
by eachro 6y ago
This is super minor but I really wish f-string formatting were the default behavior for `print` or that there were a `printf` command just for it. Typing that extra f character before the quotes is just annoying enough
- musicale 6y agoAnd while they're at it, bring back the print statement. It was a beautiful thing and made it possible to write the same "hello world" program in Python and BASIC: print "hello, world"
- ghshephard 6y agoAs a novice Python scripter, I felt that way for about 6 months. Then grumbled but accepted why making print a function was a good thing. Then spent another year frequently forgetting the brackets. Then another 6 months occasionally forgetting the brackets. Now, about 2 years after I converted to Python3, I finally have fully accepted that having print as a function is a good universal thing. At the very least, having an "end=" and "sep=" option eliminated 10,000 newbie python questions a year.
- DylanDmitri 6y agoYeah it's a backwards compatibility issue, wouldn't be surprised if they make this change in Python4
- pansa2 6y agoMaking f-strings the default was discussed at the Python Language Summit last year: https://pyfound.blogspot.com/2020/04/all-strings-become-f-strings-python.html https://pyfound.blogspot.com/2020/04/all-strings-become-f-st...
- kzrdude 6y agoI just find the convergent evolution funny, that my C fingers that could type `printf()` fluently now learn to type `print(f"")` the same way