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 ezio.melotti
Recipients ezio.melotti, rhettinger
Date 2011-10-14.12:19:09
SpamBayes Score 3.9121562e-10
Marked as misclassified No
Message-id <1318594750.97.0.446461208039.issue13177@psf.upfronthosting.co.za>
In-reply-to
Content
The attached patch changes lru_cache to use if/else instead of try/except.
This has 2 effects:
1) it avoids chained exceptions and makes the error messages clearer;
2) it probably makes lru_cache a bit faster since building and catching exceptions is expensive. It also gets rid of the KeyError=KeyError optimization/hack;

For a couple of examples of 1) see #12749 (msg142059, msg142063), or #13169 (msg145469).  See also related issue #6210.
History
Date User Action Args
2011-10-14 12:19:11ezio.melottisetrecipients: + ezio.melotti, rhettinger
2011-10-14 12:19:10ezio.melottisetmessageid: <1318594750.97.0.446461208039.issue13177@psf.upfronthosting.co.za>
2011-10-14 12:19:10ezio.melottilinkissue13177 messages
2011-10-14 12:19:10ezio.melotticreate