Message330313
> 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 :-)
https://docs.python.org/dev/library/functools.html#functools.lru_cache |
|
Date |
User |
Action |
Args |
2018-11-23 12:15:30 | vstinner | set | recipients:
+ vstinner, rhettinger, bolorsociedad |
2018-11-23 12:15:29 | vstinner | set | messageid: <1542975329.95.0.788709270274.issue35300@psf.upfronthosting.co.za> |
2018-11-23 12:15:29 | vstinner | link | issue35300 messages |
2018-11-23 12:15:29 | vstinner | create | |
|