python an sqlite objects

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Wed Dec 3 13:16:29 EST 2008


skip at pobox.com a écrit :
>     Bruno> Or if you want something more portable, serialize the object to
>     Bruno> json. At least you'll have a chance to deserialize it with some
>     Bruno> other language.
> 
> Assuming json can serialize more-or-less arbitrary Python objects.

I assume the OP knows what kind of objects he's going to serialize.

>  Can
> it serialize class instances?

instances of which class ?-)

More seriously: simplejson knows how to serialize most builtin types. 
For other types, you have to write your own serializer, but it's 
_usually_ quite simple. Most of the time, you want to serialize the 
instance's __dict__.




More information about the Python-list mailing list