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 gvanrossum
Recipients gvanrossum, mlvanbie
Date 2007-12-19.23:03:17
SpamBayes Score 0.36853716
Marked as misclassified No
Message-id <1198105397.89.0.301034594763.issue1515@psf.upfronthosting.co.za>
In-reply-to
Content
I disagree that this would be harmless; this was excluded intentionally.
 A (bound) method contains an instance which definitely represents state
and calling the method can easily mutate that state.

This is different from classes (which could contain state) or modules
(which almost certainly contain state) or functions (which could mutate
global state) -- in all those cases, we're talking about singleton
state, for which it makes sense not to create a clone.  But for methods,
we're talking about instances, of which there could be many, and I
believe those should be properly copied or refused, rather than creating
accidental state sharing between the original and its deep copy.

I suppose you have a specific use case in mind.  Can't you solve that by
adding a __deepcopy__ method to some object?
History
Date User Action Args
2007-12-19 23:03:18gvanrossumsetspambayes_score: 0.368537 -> 0.36853716
recipients: + gvanrossum, mlvanbie
2007-12-19 23:03:17gvanrossumsetspambayes_score: 0.368537 -> 0.368537
messageid: <1198105397.89.0.301034594763.issue1515@psf.upfronthosting.co.za>
2007-12-19 23:03:17gvanrossumlinkissue1515 messages
2007-12-19 23:03:17gvanrossumcreate