[sage-support] Re: question about .extend

2008-11-15 Thread Mike Hansen
> Another puzzling thing is that > b=[ ] > %timeit b.extend([2]) > 100 loops, best of 3: 801 ns per loop > > type(b) > > > but then when I run > > %timeit b+[2] > 10 loops, best of 3: 88.9 ms per loop > > That's much slower, in fact if you simple type b and hit enter... SAGE > hangs. This is

[sage-support] Re: question about .extend

2008-11-15 Thread Robert Bradshaw
On Nov 15, 2008, at 5:02 PM, pong wrote: > > According to diveintopython .extend should be faster than + since the > former does not return a value. > I was curious and tried > > %timeit [ ]+[2] > 100 loops, best of 3: 741 ns per loop > and > > %timeit [ ].extend([2]) > 100 loops, best of