[Baypiggies] newbie question - json as pickler
Aahz
aahz at pythoncraft.com
Mon Feb 22 15:50:54 CET 2010
On Mon, Feb 22, 2010, K. Richard Pixley wrote:
>
> Problem #2: the object encoding serializers that I've found are strictly
> string->object and object->string. This would seem to make a number of
> things awkward. Spitting out a sequence of objects as a sequence of
> strings is easy. However, it's looking to me as though reading that
> sequence of strings will require parsing the incoming stream in order to
> divide them up into chunks suitable for handing off to the deserializer.
> This seems like it makes the serializers essentially useless.
Just serialize a list of objects.
> I feel like I must be missing something here. Does anyone else see it?
> Is there an obvious way to break up the byte stream? Is there an easy
> way to tease the standard library coder into coding arbitrary objects?
You do what pickle essentially does: serialize o.__dict__
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"At Resolver we've found it useful to short-circuit any doubt and just
refer to comments in code as 'lies'. :-)"
More information about the Baypiggies
mailing list