This lets an application use a custom JSONEncoder when making jsonrpc calls (to automatically handle, say, serialization of datetime, or Decimal, or custom classes).
e.g.:
import json, datetime, decimal
class ExtendedEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return obj.isoformat()
if isinstance(obj, decimal.Decimal):
return str(obj)
return super(ExtendedEncoder, self).default(obj)
api = ServerProxy(address, version='2.0', encoder=ExtendedEncoder)