use(module=None,
decode=None,
encode=None)
|
|
Set the JSON library that should be used, either by specifying a known
module name, or by providing a decode and encode function.
The modules "simplejson", "cjson", and "json" are currently supported for
the module parameter.
If provided, the decode parameter must be a callable that accepts a
JSON string and returns a corresponding Python data structure. The
encode callable must accept a Python data structure and return the
corresponding JSON string. Exceptions raised by decoding and encoding
should be propagated up unaltered.
- Parameters:
module (str or module) - the name of the JSON library module to use, or the module
object itself
decode (callable) - a function for decoding JSON strings
encode (callable) - a function for encoding objects as JSON strings
|