Re: pickle question: sequencing of operations

2012-05-09 Thread Russell E. Owen
In article calwzidk3e353cnuuqpwr-4rromx7c9dbzapawurern9uzyu...@mail.gmail.com, Ian Kelly ian.g.ke...@gmail.com wrote: On Tue, May 8, 2012 at 1:19 PM, Russell E. Owen ro...@uw.edu wrote: In article rowen-df116b.12542704052...@news.gmane.org,  Russell E. Owen ro...@uw.edu wrote: What is

Re: pickle question: sequencing of operations

2012-05-09 Thread Ian Kelly
On Wed, May 9, 2012 at 1:39 PM, Russell E. Owen ro...@uw.edu wrote: I was wondering. I override __new__ (and __init__) to print messages and was quite surprised to only see __new__being called when the object was first created, not when it was being unpickled. But maybe there's something funny

Re: pickle question: sequencing of operations

2012-05-09 Thread Ian Kelly
On Wed, May 9, 2012 at 2:34 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, May 9, 2012 at 1:39 PM, Russell E. Owen ro...@uw.edu wrote: I was wondering. I override __new__ (and __init__) to print messages and was quite surprised to only see __new__being called when the object was first

Re: pickle question: sequencing of operations

2012-05-08 Thread Russell E. Owen
In article rowen-df116b.12542704052...@news.gmane.org, Russell E. Owen ro...@uw.edu wrote: What is the sequence of calls when unpickling a class with __setstate__? From experimentation I see that __setstate__ is called and __init__ is not, but I think I need more info. I'm trying to

Re: pickle question: sequencing of operations

2012-05-08 Thread Ian Kelly
On Tue, May 8, 2012 at 1:19 PM, Russell E. Owen ro...@uw.edu wrote: In article rowen-df116b.12542704052...@news.gmane.org,  Russell E. Owen ro...@uw.edu wrote: What is the sequence of calls when unpickling a class with __setstate__? I believe it just calls object.__new__ followed by

pickle question: sequencing of operations

2012-05-04 Thread Russell E. Owen
What is the sequence of calls when unpickling a class with __setstate__? From experimentation I see that __setstate__ is called and __init__ is not, but I think I need more info. I'm trying to pickle an instance of a class that is a subclass of another class that contains unpickleable objects.