John Salerno wrote:
> My initial feeling is that concatenation might take longer than 
> substitution

Doesn't look that way:

[EMAIL PROTECTED]:~$ python -m timeit "'<p>%s</p>\n\n' % 'foobar'"
1000000 loops, best of 3: 0.6 usec per loop
[EMAIL PROTECTED]:~$ python -m timeit "'<p>' + 'foobar' + '</p>\n\n'"
1000000 loops, best of 3: 0.358 usec per loop


> but that it is also easier to read:

I prefer string formatting for readability, but it's a matter of 
personal preference.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to