This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Itayazolay, bar.harel, rhettinger
Date 2020-07-06.23:47:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594079264.56.0.572032769641.issue41220@roundup.psfhosted.org>
In-reply-to
Content
>>> from functools import lru_cache
>>> def my_make_key(my_list):
...   return my_list[0]
...
>>> @lru_cache(128, make_key=my_make_key)
... def cached_func(my_list):
...   return sum(my_list)
...
>>> cached_func([10, 20, 30])
60
>>> cached_func([10, 11, 12]) # <-- Why would we want this to return 60?
60

This seems unsafe.
History
Date User Action Args
2020-07-06 23:47:44rhettingersetrecipients: + rhettinger, bar.harel, Itayazolay
2020-07-06 23:47:44rhettingersetmessageid: <1594079264.56.0.572032769641.issue41220@roundup.psfhosted.org>
2020-07-06 23:47:44rhettingerlinkissue41220 messages
2020-07-06 23:47:44rhettingercreate