python string, best way to concat

Mark Lawrence breamoreboy at yahoo.co.uk
Thu Aug 28 04:43:07 EDT 2014


On 28/08/2014 09:30, peter wrote:
> I used to struggle with the concept of ''.join(('hello ','world')) - it seemed so convoluted compared with the intuitive 'hello '+'world', and I could never remember the syntax.  Also, for the strings I was generally using the performance penalty was infinitesimal, so I was just adding complexity for the sake of the abstract concept of a more 'pythonic' style.
>
> Obviously this isn't going to change, but for concatenating short strings a and b is there any practical reason to avoid a+b?
>
> Peter
>

Please quote context, there's some smart people on this list but none of 
them are mind readers :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list