Confused compare function :)

Chris Angelico rosuav at gmail.com
Sat Dec 8 08:17:19 CET 2012


On Sat, Dec 8, 2012 at 6:01 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> Unfortunately, catching exceptions may be and often is as slow as the
> redundant check and even multiple redundant checks.

It depends on how often you're going to catch and how often just flow
through. In Python, as in most other modern languages, exceptions only
cost you when they get thrown. The extra check, though, costs you in
the normal case.

ChrisA



More information about the Python-list mailing list