[Python-ideas] A cute Python implementation of itertools.tee
Steven D'Aprano
steve at pearwood.info
Mon Apr 16 06:08:34 EDT 2018
On Sun, Apr 15, 2018 at 08:35:51PM +0300, Serhiy Storchaka wrote:
> I have ideas about implementing zero-overhead try/except, but I have
> doubts that it is worth. The benefit seems too small.
It is conventional wisdom that catching exceptions is expensive, and
that in performance critical code it is better to "look before you leap"
if possible, and avoid try...except.
Are you saying this advice is obsolete?
If not, then perhaps reducing the overhead of catching exceptions may be
worthwhile.
--
Steve
More information about the Python-ideas
mailing list