4 ms·
This is a massive improvement. I currently use .format(), sometimes with locals(), but f-strings would improve this massively. Now if only they didn't require
by JoshTriplett 11y ago
This is a massive improvement. I currently use .format(), sometimes with locals(), but f-strings would improve this massively.
Now if only they didn't require Python 3, so I could use them on the production systems I'm working on...
- ant6n 11y agoI switch back and forth between format and %, and never use locals in the format. It's annoying, every time a string is written, to try to decide which way is better for this instance. That said, is there a way to do ('%.3f' % x) with this?
- JoshTriplett 11y agof'{x:.3f}'