> 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
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