'Serialize Python object.
This function is meant to be passed as ``default`` to
:func:`json.dump` or :func:`json.dumps`. They call
``default(python_object)`` only for non-basic Python types, so
this function necessarily raises :class:`TypeError` if
``python_object`` is not an instance of
:class:`IJSONSerializable`.
Please read the class docstring for more information.'

@classmethod
def json_dump_default(cls, python_object):

    if isinstance(python_object, JSONDeSerializable):
        return python_object.to_partial_json()
    else:
        raise TypeError((repr(python_object) + '    is    not    JSON    serializable'))
