Author jaraco
Recipients jaraco, python-dev, rhettinger, serhiy.storchaka
Date 2015-12-27.17:09:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I've since moved the jaraco.functools project to Github, so here are updated links for those found in the original post to the [downstream bug]( and the [offended code](

I've since realized, thanks to the test suite on jaraco.functools, a [follow-on issue]( where it seems that if the deepcopy occurs on a wrapped partial, it will still fail, because the lru cache wrapper has no qualname:

$ cat >
import copy
from functools import lru_cache, partial

foo = lru_cache()(partial(print, 'out'))

$ python3.5
Traceback (most recent call last):
  File "", line 5, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/", line 174, in deepcopy
    rv = reductor(4)
AttributeError: 'functools._lru_cache_wrapper' object has no attribute '__qualname__'

I realize now that when I reviewed the patch, I did not take the time to test it against my full use case, but only relied on the tests as committed, which did not cover this more nuanced usage.

On further consideration, this error highlights a potential subtle difference in the reduce support between the C implementation and the Python implementation.

In digging into the implementation, I don't yet fully understand how it is that the Python implementation survives a deepcopy, but I'd like to revisit this issue to see if it may be possible to make it so.
Date User Action Args
2015-12-27 17:09:39jaracosetrecipients: + jaraco, rhettinger, python-dev, serhiy.storchaka
2015-12-27 17:09:39jaracosetmessageid: <>
2015-12-27 17:09:39jaracolinkissue25447 messages
2015-12-27 17:09:39jaracocreate