470,591 Members | 2,165 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

deepcopy in new-style classes

I have defined a set of new-style classes that override __getstate__()
and __setstate__(). For these classes, copy.deepcopy works fine as long
as __getstate__() returns a value other than None, False, [], {}, '' and
0. The 2.3 documentation says: """For new-style classes, if
__getstate__() returns a false value, the __setstate__() method will not
be called. """ Why is this the case? And is there someway to get around
this, i.e. force __setstate__() to be called anyway?

Donnal Walter
Arkansas Children's Hospital

Jul 18 '05 #1
0 1024

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Eugeni Doljenko | last post: by
1 post views Thread by OKB (not okblacke) | last post: by
reply views Thread by Dan Perl | last post: by
7 posts views Thread by 5HH575-UAZWKVVP-7H2H48V3 | last post: by
reply views Thread by Joshua Ginsberg | last post: by
7 posts views Thread by Alexandre Guimond | last post: by
3 posts views Thread by none | last post: by
reply views Thread by Robin Becker | last post: by
1 post views Thread by Wouter DW | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.