[Python-ideas] One way to do format and print

Random832 random832 at fastmail.com
Tue Sep 8 01:28:13 CEST 2015

Ryan Gonzalez <rymg19 at gmail.com> writes:
> t = (1, 2, 3)
> # 400 lines later...
> print '%s' % t # oops!

I always use % (t,) when intending to format a single object. But
anyway, my ideal version of it would have a .format method, but using
identical format strings. My real question was what the benefit of the
{}-format for format strings is, over an extended %-format.

More information about the Python-ideas mailing list