[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-09-14 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-09-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +8728 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-09-14 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +8727 stage: needs patch -> patch review ___ Python tracker ___

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-06-25 Thread Srinivas Reddy T
Srinivas Reddy T added the comment: Hi Raymond, I find your statement hard to understand.I agree with Solstag, it is always helpful to have an example. +1 for solstag wording. -- nosy: +thatiparthy ___ Python tracker

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-06-25 Thread Al-Scandar Solstag
Al-Scandar Solstag added the comment: Speaking frankly, I might not have grasped what might happen by reading your line. I think having at least a minimal example is crucial. Perhaps: "Distinct argument patterns, such as `f(1)` and `f(first_arg=1)`, may not cache for each other even if the

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-06-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: I propose this, "Distinct argument patterns may be considered to be distinct calls with distinct results even if the underlying function sees them as equivalent calls." -- ___ Python tracker

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-06-06 Thread Al-Scandar Solstag
Al-Scandar Solstag added the comment: Hi Raymond, I think I understand what you mean, and would suggest something along the lines of: """ Note that lru_cache only guarantees cache matches on the exact way function arguments are specified, so the following ways of calling 'def f(a, b=7)' are

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-06-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sure, I can add a line mentioning that distinct argument patterns may be considered as distinct cache entries even though they otherwise seem to be equivalent calls. That will just be a general statement though. The specific details are implementation

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-06-05 Thread R. David Murray
R. David Murray added the comment: Agreed that this should be documented. -- nosy: +r.david.murray, rhettinger stage: -> needs patch title: Improve doc of @lru_cache to avoid misuse and confusion -> Document that @lru_cache caches based on exactly how the function arguments are