Re: Quickest way to concatenate strings

2018-10-12 Thread Alan Bawden
"Frank Millman" writes: > I have often read that the quickest way to concatenate a number of strings > is to place them in a list and 'join' them - > > C:\Users\User>python -m timeit -s "x='a'*500; y='b'*500; z='c'*500" > ''.join([x, y, z]) ... > > I seem to have found a quicker method,

Re: Quickest way to concatenate strings

2018-10-12 Thread Frank Millman
"Dennis Lee Bieber" wrote in message news:cnk0sdl5a7p17framc5er811p1230mp...@4ax.com... On Fri, 12 Oct 2018 07:55:58 +0200, "Frank Millman" declaimed the following: >I have often read that the quickest way to concatenate a number of >strings >is to place them in a list and 'join' them - >

Re: Quickest way to concatenate strings

2018-10-12 Thread Frank Millman
On 12/10/2018 08:36, Thomas Jollans wrote: > On 12/10/2018 07:55, Frank Millman wrote: > Hi all > > > I have often read that the quickest way to concatenate a number of > > strings is to place them in a list and 'join' them - > > > > > > C:\Users\User>python -m timeit -s "x='a'*500; y='b'*

Re: Quickest way to concatenate strings

2018-10-12 Thread Thomas Jollans
On 12/10/2018 07:55, Frank Millman wrote: Hi all I have often read that the quickest way to concatenate a number of strings is to place them in a list and 'join' them -    C:\Users\User>python -m timeit -s "x='a'*500; y='b'*500; z='c'*500" ''.join([x, y, z])    50 loops, best of 5: 30

Quickest way to concatenate strings

2018-10-11 Thread Frank Millman
Hi all I have often read that the quickest way to concatenate a number of strings is to place them in a list and 'join' them - C:\Users\User>python -m timeit -s "x='a'*500; y='b'*500; z='c'*500" ''.join([x, y, z]) 50 loops, best of 5: 307 nsec per loop I seem to have found a quick