How to increase the speed of this program?

Fredrik Lundh fredrik at pythonware.com
Tue Nov 28 20:07:07 CET 2006


John Machin wrote:

> Thanks, that's indeed faster than array(t, [v]*n) but what I had in
> mind was something like an additional constructor:
> 
> array.filledarray(typecode, repeat_value, repeat_count)
> 
> which I speculate should be even faster.

before you add a new API, you should probably start by borrowing the 
repeat code from Object/stringobject.c and see if the speedup is good 
enough.

</F>




More information about the Python-list mailing list