Message145511
| 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: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 |
|