Is try-except slow?

John Machin sjmachin at lexicon.net
Tue Sep 2 21:54:29 EDT 2008


On Sep 3, 11:14 am, process <circularf... at gmail.com> wrote:
> is this faster btw?

Time it and see.

> I guess big doesn't help, it's only retrieved once
> anyway?

Correct.

> But is rows retrieved in every loop?

Of course. Read your own code! The point is that retrieving the list
referenced by "rows" is much faster than creating it needlessly each
time.

> the python interpreter
> aint too smart?

It's smarter than some. The trade-off for having a very dynamic
language is that some compile-time optimisations are more difficult.
If you are interested in work (being)? done in this area, look at
psyco and PyPy.




More information about the Python-list mailing list