[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

[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 callin

[issue33774] Improve doc of @lru_cache to avoid misuse and confusion

2018-06-05 Thread Al-Scandar Solstag
New submission from Al-Scandar Solstag : Ni! It is not clear at all in the documentation of @lru_cache that the cache takes into account the exact way the function was called, not the values passed to its arguments, as one could/would expect. I mean that for function(a, b, c=3) the three