Message145511
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. |
|
Date |
User |
Action |
Args |
2011-10-14 12:19:11 | ezio.melotti | set | recipients:
+ ezio.melotti, rhettinger |
2011-10-14 12:19:10 | ezio.melotti | set | messageid: <1318594750.97.0.446461208039.issue13177@psf.upfronthosting.co.za> |
2011-10-14 12:19:10 | ezio.melotti | link | issue13177 messages |
2011-10-14 12:19:10 | ezio.melotti | create | |
|