Gabriel Genellina wrote:
> En Mon, 16 Nov 2009 19:30:27 -0300, Hyunchul Kim
> 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 r
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 "t
On Mon, Nov 16, 2009 at 6:28 PM, Raymond Hettinger wrote:
> On Nov 16, 2:41 pm, Chris Rebert wrote:
>> On Mon, Nov 16, 2009 at 2:30 PM, Hyunchul Kim
>>
>> wrote:
>> > Hi, all.
>>
>> > I want to improve speed of following simple function.
>> > Any suggestion?
>>
>> > **
>> > def triple(in
En Mon, 16 Nov 2009 19:30:27 -0300, Hyunchul Kim
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 my best attempts:
def tri
On Nov 16, 2:41 pm, Chris Rebert wrote:
> On Mon, Nov 16, 2009 at 2:30 PM, 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.
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:
yield
On Mon, Nov 16, 2009 at 2:30 PM, 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
> **
You'd probably
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