bpo-36694: Do not memoize temporary objects in the C implementation of pickle. by serhiy-storchaka · Pull Request #13036 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It mostly affects temporary objects. For example, if __reduce__ returns constructor, ((x, y),) then the tuple (x, y) will not be memoized. This is a case of namedtuples.
Another example: if you have a list of unique numbers, strings, tuples, etc, then items of the list will not be memoized as the only reference to the item is from the list.