PEP0238 lament

Terry Reedy tjreedy at
Tue Jul 24 17:29:25 CEST 2001

> 3.  I dislike % substitution because I dislike sprintf formatting,
>     besides - I tend to think it should specify the subscript for
>     data to substitute in the string - not just rely on the
>     order.

Off the subject of the thread, but ...

Are you aware of substitution by name and dictionary?  For instance

quot,rem = divmod(amount,100)
print 'most = %(quot)d, rest = %(rem)d' % locals()

These is easy to miss the first time thru the docs (oh, just like
and underutilized in quickly-written posted examples.

Terry J. Reedy

More information about the Python-list mailing list