Realistically, we don't have a chance of pickling interface objects when we don't have any deeper understanding of the object in the interfaced system. Unless the interfaced system supports pickling natively, which few do.
So my suggestion would be to define x.dumps() as x.sage().dumps(), that is, just pickle the value in Sage. Doesn't work for the singular(3) example since the conversion Singular integers->Sage integers hasn't been implemented but at least you get the error immediately and not later when you try to load the object. On Friday, July 3, 2015 at 10:21:13 AM UTC+2, Nathann Cohen wrote: > > Helloooooo everybody, > > A friend of mine just reported something which may be considered as a bug: > > sage: x=singular(3) > sage: save(x,"/tmp/aaa.sobj") > > Several days later: > > sage: load("/tmp/aaa.sobj") > (invalid object -- defined in terms of closed session) > > This, because 'x' is not an integer but a reference for a singular value. > > Sooo what do we do? Perhaps we should convert this reference toward a > Sage object if we can, but if we cannot then perhaps we should give a > warning? It seems that saving these objects will always turn out to be > a disappointment. > > Have fuuuuuuuuun, > > Nathann > > P.S.: The same happens if you run the 'load' command right after the > 'save'. So even if the session still exists the result is lost. > -- 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.