3 ms·
> Pad left? That's a two-line method at most. The functionality comes from the prior string.format method, which has been around since Python 2.6 (first releas
by zahlman 1y ago
> Pad left? That's a two-line method at most.
The functionality comes from the prior string.format method, which has been around since Python 2.6 (first released in 2008).
https://docs.python.org/2.6/library/string.html#formatspec https://docs.python.org/2.6/library/string.html#formatspec
> It's faster to do it yourself ad-hoc.
I have found the syntax to be quite mentally "sticky".
> the implementation is right there (and easy to customize!) not buried in the docs and immutable.
There are hooks to customize it.