Michael Van Biesbrouck added the comment:

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.

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1515>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to