Thank Tim, Raymond, and all.
In my test, Tim's t1 was fastest and Raymond's triple3 is very near to Tim's
t1.
Anyway both of them took only 6~7% time of my original .extend() version.
I think that following n_ple() is a good generalized function that was 1~3%
slower than t1() and triple3() for
Gabriel Genellina wrote:
En Mon, 16 Nov 2009 19:30:27 -0300, Hyunchul Kim
hyunchul.mail...@gmail.com escribió:
I want to improve speed of following simple function.
Any suggestion?
**
def triple(inputlist):
results = []
for x in inputlist:
results.extend([x,x,x])
Hi, all.
I want to improve speed of following simple function.
Any suggestion?
**
def triple(inputlist):
results = []
for x in inputlist:
results.extend([x,x,x])
return results
**
Thank you in advance,
Hyunchul
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Nov 16, 2009 at 2:30 PM, Hyunchul Kim
hyunchul.mail...@gmail.com wrote:
Hi, all.
I want to improve speed of following simple function.
Any suggestion?
**
def triple(inputlist):
results = []
for x in inputlist:
results.extend([x,x,x])
return results
**
Hyunchul Kim wrote:
Hi, all.
I want to improve speed of following simple function.
Any suggestion?
**
def triple(inputlist):
results = []
for x in inputlist:
results.extend([x,x,x])
return results
**
Several ways occur to me:
def t1(i):
for x in i:
On Nov 16, 2:41 pm, Chris Rebert c...@rebertia.com wrote:
On Mon, Nov 16, 2009 at 2:30 PM, Hyunchul Kim
hyunchul.mail...@gmail.com wrote:
Hi, all.
I want to improve speed of following simple function.
Any suggestion?
**
def triple(inputlist):
results = []
for x in
En Mon, 16 Nov 2009 19:30:27 -0300, Hyunchul Kim
hyunchul.mail...@gmail.com escribió:
I want to improve speed of following simple function.
Any suggestion?
**
def triple(inputlist):
results = []
for x in inputlist:
results.extend([x,x,x])
return results
**
These are
On Mon, Nov 16, 2009 at 6:28 PM, Raymond Hettinger pyt...@rcn.com wrote:
On Nov 16, 2:41 pm, Chris Rebert c...@rebertia.com wrote:
On Mon, Nov 16, 2009 at 2:30 PM, Hyunchul Kim
hyunchul.mail...@gmail.com wrote:
Hi, all.
I want to improve speed of following simple function.
Any