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 mlvanbie
Recipients gvanrossum, mlvanbie
Date 2008-01-08.00:11:28
SpamBayes Score 0.10237984
Marked as misclassified No
Message-id <1199751099.04.0.234369996262.issue1515@psf.upfronthosting.co.za>
In-reply-to
Content
Guido pointed out a common use case where people use bound methods in a
way that would be poorly served by my change.  An alternate
implementation with a deeper copy will cause less surprise:

def _deepcopy_method(x, memo):
    return type(x)(x.im_func, deepcopy(x.im_self, memo), x.im_class)
d[types.MethodType] = _deepcopy_method

The function and class are still shallow-copied but the bound object is
deep-copied.  I use type(x)() instead of types.MethodType() because
types will be unbound when the function runs.
History
Date User Action Args
2008-01-08 00:11:39mlvanbiesetspambayes_score: 0.10238 -> 0.10237984
recipients: + mlvanbie, gvanrossum
2008-01-08 00:11:39mlvanbiesetspambayes_score: 0.10238 -> 0.10238
messageid: <1199751099.04.0.234369996262.issue1515@psf.upfronthosting.co.za>
2008-01-08 00:11:29mlvanbielinkissue1515 messages
2008-01-08 00:11:28mlvanbiecreate