I'm working on points and morphisms of projective space with #15780 and 
I've come across an issue that is related to save/load. So, I've been 
experimenting try to see what works and what doesn't and I've come to the 
conclusion that I don't really know how it works. Here are two examples, 
one of which works, one of which doesn't.

If I try to save a list of projective points it failes. But if I make a 
projective function the first entry (but not the 2nd or 3rd), then it 
works. If there is only one point in the list it also works. Otherwise I 
get an error like:

Traceback (most recent call last):    f=H([x^2-y^2,y^2])
  File "", line 1, in <module>
    
  File "/tmp/tmpdpkZt2/___code___.py", line 12, in <module>
    exec compile(u'load(objfile_short)
  File "", line 1, in <module>
    
  File "sage_object.pyx", line 862, in sage.structure.sage_object.load 
(sage/structure/sage_object.c:9774)
  File "sage_object.pyx", line 1236, in sage.structure.sage_object.loads 
(sage/structure/sage_object.c:11522)
  File "element.pyx", line 404, in 
sage.structure.element.Element.__setstate__ (sage/structure/element.c:4342)
  File "element.pyx", line 268, in 
sage.structure.element.Element._set_parent (sage/structure/element.c:3664)
TypeError: Cannot convert dict to sage.structure.parent.Parent

here are the two examples

{{{
objfile = os.path.join(SAGE_TMP, 'test.sobj')
objfile_short = os.path.join(SAGE_TMP, 'test')
P.<x,y>=ProjectiveSpace(QQ,1)
H=End(P)
Q=P(1)
R=P(2)
f=H([x^2-y^2,y^2])
r=[f,R,Q]
save(r, objfile)
load(objfile_short)
}}}

{{{
objfile = os.path.join(SAGE_TMP, 'test.sobj')
objfile_short = os.path.join(SAGE_TMP, 'test')
P.<x,y>=ProjectiveSpace(QQ,1)
H=End(P)
Q=P(1)
R=P(2)
f=H([x^2-y^2,y^2])
r=[Q,R]
save(r, objfile)
load(objfile_short)
}}}

If someone could explain to me why this is failing that would be very 
helpful. Or even point me to where to look in the source to track this down.

Thanks,
  Ben

-- 
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