When Python outruns C++ ...
Andrew Dalke
adalke at mindspring.com
Tue Apr 1 22:34:44 EST 2003
Greg Ewing:
> This kind of thing has been observed before -- I believe
> someone noticed that using get() on a dict was slower than
> indexing and catching the exception.
Barry Warsaw, IPC...6? The one in San Jose, I think.
Yep, here it is.
http://barry.warsaw.us/papers/ecshort.pdf
It shows that try/except is faster than setdefault when
the number of exceptions is low.
Andrew
dalke at dalkescientific.com
More information about the Python-list
mailing list