3 ms·
I use format because you can break lines within the parentheses. You also get to name parameters, which is nice and explicit. I also import print_function from
by a3n 12y ago
I use format because you can break lines within the parentheses. You also get to name parameters, which is nice and explicit.
I also import print_function from the future, mainly because you can break lines inside the parentheses.
I also use ' '.join([...]) for the same reason when building a large-ish string, you can break lines inside parentheses (or square brackets in this case).
I like breaking lines inside parentheses and other delimiters.
- mixmastamyk 12y agoShould be able to do both of those with % as well: print '%(foo)s %(bar)s' % dict( foo='foo', bar='bar', )
- a3n 12y agohuh. I like it when I learn something new every day.