On 7/2/06, Webb Sprague <[EMAIL PROTECTED]> wrote: > Given the long history of python and its ancestry in C (for which zero > based indexing made lots of sense since it dovetailed with thinking in > memory offsets in systems programming), there is probably nothing to > be done now. I guess I just want to vent, but also to ask if anyone > has found any way to deal with this issue in their own scientific > programming.
Aha! Guido himself prefers starting the index at one. Here's a code snippet from a fun article he wrote about optimizing python code: import time def timing(f, n, a): print f.__name__, r = range(n) t1 = time.clock() for i in r: f(a); f(a); f(a); f(a); f(a); f(a); f(a); f(a); f(a); f(a) t2 = time.clock() print round(t2-t1, 3) http://www.python.org/doc/essays/list2str/ Notice he chose t1 and t2 instead of t0 and t1. QED Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion