[issue42711] lru_cache and NotImplemented

2020-12-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the suggestion, but I think it is better to use the tool as designed without any special cases. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue42711] lru_cache and NotImplemented

2020-12-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: > has the potential to fill the LRU cache with calls that > will in ultimately result in errors How would a call result in an error? The worst that can happen is a cache miss and the underlying function gets called. > Change `functools.lru_cache` not ca

[issue42711] lru_cache and NotImplemented

2020-12-21 Thread Kaleb Barrett
New submission from Kaleb Barrett : Having to return `NotImplemented` (which counts as a successful function call) in `functools.lru_cache` and `functools.cache` decorated binary dunder methods has the potential to fill the LRU cache with calls that will in ultimately result in errors (read "