On Jan 27, 11:32 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: [...] > > simple_posmax is more than 3x faster on my machine. It's not > surprising as even though the list is walked twice, it is all done in > C and no new objects have to be created. Then only non-C bit is when > the result of max(l) is fed to l.index().
Of course that's incorrect in general: if comparison functions between objects in l are python functions then some bytecode will be run and some new objects may be created. But in most cases I think it stands true. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list