On Thursday, April 10, 2014 9:38:36 AM UTC-7, Ben Hutz wrote:
>
> Well I'm getting closer. When loads is called on a list containing 2 
> (distinct) points the first loads does fine, the second point __setstate__ 
> is called with just the dict instead of (parent,dict). If it is say, 2 
> distinct functions with the same parent, it works correctly (both called 
> with (parent,dict). I still haven't found the code that is calling 
> __setstate__ in the first place to see why the parent is getting dropped.
>
> So, I'm still hoping someone can save me a bunch of time searching by 
> pointing to where the details are implemented.
>

 Only a generic remark: __setstate__ is part of python's pickle protocol. 
Basically, "save" wrote in the "obj" file first the instructions to 
minimally create the object (for a pure python class: a __new__ call with 
basically no parameters) and then instructions to complete the its setting 
(for a pure python class: putting its dict in place). This is to ensure 
that all objects are "nominally" there so that circular references can be 
recreated. 

we've had trouble with this before, especially when these partially created 
objects have custom __eq__ or __hash__ and are then used as keys in a dict. 
We don't really have a solution for that problem yet. Your problem may or 
may not be similar.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to