(original) (raw)


2013/2/13 Lennart Regebro <regebro@gmail.com>

On Wed, Feb 13, 2013 at 1:10 PM, Serhiy Storchaka <storchaka@gmail.com> wrote:
\> I prefer "x = '%s%s%s%s' % (a, b, c, d)" when string's number is more than 3
\> and some of them are literal strings.

This has the benefit of being slow both on CPython and PyPy. Although
using .format() is even slower. :-)

Did you really try it?
PyPy is really fast with str.\_\_mod\_\_, when the format string is a constant.
Yes, it's jitted.

--
Amaury Forgeot d'Arc