This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jimbofbx
Recipients Jim.Jewett, Jimbofbx, Ramchandra Apte, jcea, pitrou, python-dev, rhettinger, serhiy.storchaka, skrah
Date 2012-04-10.17:00:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334077210.31.0.804080673441.issue14478@psf.upfronthosting.co.za>
In-reply-to
Content
In the patch:

This:
+        except AttributeError:
+            pass

should be:
+        except:
<everything inside except statement>

Checking for the AttributeError is very slightly slower. Not by a lot, but I think if we're going for speed we might as well be as fast as possible. I can't imagine any other exception coming from that try statement.

Using except: pass as opposed to sticking everything inside the except statement is also very slightly slower as well

Simple test case, 10 million loops:
except: 7.140999794006348
except AttributeError: 7.8440001010894775

Exception code
in except: 7.483999967575073
after except/pass: 7.75
History
Date User Action Args
2012-04-10 17:00:10Jimbofbxsetrecipients: + Jimbofbx, rhettinger, jcea, pitrou, skrah, python-dev, Ramchandra Apte, Jim.Jewett, serhiy.storchaka
2012-04-10 17:00:10Jimbofbxsetmessageid: <1334077210.31.0.804080673441.issue14478@psf.upfronthosting.co.za>
2012-04-10 17:00:09Jimbofbxlinkissue14478 messages
2012-04-10 17:00:09Jimbofbxcreate