Author vstinner
Recipients bolorsociedad, rhettinger, vstinner
Date 2018-11-23.12:15:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> When the returned mutable object is modified, the cache is modified as well. In my opinion, functools.lru_cache should store a deep copy of the returned object.

It would be inefficient to deep copy the mutable result and can defeat the purpose of the cache...

I would rather to add a note to the documentation to explain to either not return mutable objects or to not modify them :-)
Date User Action Args
2018-11-23 12:15:30vstinnersetrecipients: + vstinner, rhettinger, bolorsociedad
2018-11-23 12:15:29vstinnersetmessageid: <>
2018-11-23 12:15:29vstinnerlinkissue35300 messages
2018-11-23 12:15:29vstinnercreate