08-08-2009 Steven D'Aprano <st...@remove-this-cybersource.com.au> wrote:

On Fri, 07 Aug 2009 17:35:28 +0000, kj wrote:

I fail to see why

x = ("first part of a very long string "
     "second part of a very long string")

That's done by the compiler at compile time and is fast.

Moreover, it's also more readable, when you use str calling its
methods or using formatting on it.

I use it very often, e.g.:

        afunction('quite long string %s quite long string '
                  'quite long string quite long string %s '
                  'quite %s long string quite long string'
                  % (variable1, variable2, variable3))

It seems nicer to me than:

        afunction(('quite long string %s quite long string '
                   + 'quite long string quite long string %s '
                   + 'quite %s long string quite long string')
                  % (variable1, variable2, variable3))

(Note that multiline-'''-strings are usless in such cases).

*j

--
Jan Kaliszewski (zuo) <z...@chopin.edu.pl>
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to