On Tue, Jun 2, 2009 at 1:40 AM, Dan Drake <dr...@kaist.edu> wrote: > The patches at #5564 need a json encoder, and there's a ticket to > include simplejson at #1510. I'd like to get this spkg in, but there are > some comments on that ticket about pickling. I don't know enough of the > details, so I thought I would ask if: > > * we need to patch the simplejson source to support serialization of > Sage objects, or if > * we can use simplejson without alteration.
I think you have to define dump(), and save() method for custom classes. There is a way to do it here (from the py2.6 docs): http://docs.python.org/library/json.html You basically have to subclass JSONEncoder/Decoder. didier > > As it stands, this spkg is holding up some the patches at #5564 which > improve UTF-8 handling in the notebook, so it would be very helpful to > have it included as a standard spkg. Note that Python 2.6 includes a > JSON module by default, so we might have to deal with these issues > sooner or later anyway. > > Dan > > -- > --- Dan Drake <dr...@kaist.edu> > ----- KAIST Department of Mathematical Sciences > ------- http://mathsci.kaist.ac.kr/~drake > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > > iEYEARECAAYFAkokuzoACgkQr4V8SljC5LqZZgCeKBRPIiw2YdqVgWkld1zblLb6 > sLMAn2YNyQOy9rQ/FU2YRHQoMiF8tK67 > =CjvG > -----END PGP SIGNATURE----- > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---