Richard Jones wrote:
I get slightly different results.On Sun, 17 Jun 2007, Richard Jones wrote: C:\Documents and Settings\Administrator>python -m timeit "float(1.0)" 1000000 loops, best of 3: 0.711 usec per loop C:\Documents and Settings\Administrator>python -m timeit "float(1)" 1000000 loops, best of 3: 0.782 usec per loop C:\Documents and Settings\Administrator>python -m timeit "isinstance(1.0, float) " 1000000 loops, best of 3: 0.598 usec per loop Although, I think its possibly too close to call, and all I can really conclude is that you have a faster computer than mine! I think Greg's idea of multiplying by 1.0 may be best from the interface point of view. Will |