PyFormat – Practical examples of old and new style string formatting
A good reference.<p>My take home is that every single version that is possible to do in old style formatting is longer in new style formatting. Even more so if the old-style formatting were written without the extraneous 1-ples.<p><pre><code>    '%4d' % 42
</code></pre>
vs<p><pre><code>    '{:4d}'.format(42)
</code></pre>
It isn't surprising that so much code is still being written in old-style. The advantages of the new style, like padding with arbitrary characters; value reuse (particularly for I18n, though that tends to use a different mechanism for production systems that need it); and nested display; are really quite minor.<p>This feeds into the other python issue on HN today - why does py3 have so little uptake? Because it is a solution to a problem few people have.