On Sat, Oct 3, 2009 at 3:10 PM, Ethan Van Andel <evlu...@gmail.com> wrote: > > > > On Oct 3, 3:01 pm, Robert Bradshaw <rober...@math.washington.edu> > wrote: >> On Oct 3, 2009, at 11:36 AM, Ethan Van Andel wrote: >> >> >> >> >> >> > I have a class Riemann Map, coded in cython and added to the sage >> > library. >> >> > I have this problem: Note that m is an instance of Riemann_Map and >> > get_szego returns an array contained in m. >> >> > sage: dumps(m) >> > 'x\x9ck`J.NLO\xd5KN\xccI.\xcd)-\xd6+\xcaL\xcdM\xcc\xcb\xe3\n >> > \x82\xd0\xf1\ >> > \xbe\x89\x05\\\x85\x8c\x9a\x8d\x85Lz\x00i\xbe\x0f@' >> >> > sage: m == loads(dumps(m)) >> > False >> >> > sage: len(dumps(m.get_szego())) >> > 63410 >> >> > Do I need to define dumps for my classes? If so, how? >> >> You need to define a __reduce__ method. You also need to make sure >> you have a __cmp__ method. >> >> - Robert > > > Sorry, but where can I find info on what those are? > > I checked the documentation but couldn't find anything helpful. >
They are Python language features. So if you type python __reduce__ into Google, the first his it is: http://docs.python.org/library/pickle.html William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---