JD
unread,Jan 25, 2011, 4:09:48 PM1/25/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jsonpickle
hi, this is a great package and i've been getting a lot of use out of
it. just curious if there was a reason to include the ability to pass
arguments to the encoder - set_encoder_options() - but not to the
decoder. the example i'm running up against is that the mongodb
python api includes a custom encoder/decoder pair to pass through the
json serializer on the default/object_hook args, respectively.
this works great for encoding a custom object with BSON-specific
fields like ObjectId, e.g.
jsonpickle.set_encoder_options('json', default=bson.json_util.default)
but decoding the object becomes impossible to do through jsonpickle
since you can't pass through the object_hook argument.
appears to be a quick patch to include decoder options similar to the
encoder ones, and i'd be happy to contribute it unless there's a
reason for excluding it that i've overlooked.
-john