def json_default(obj):
    if six.callable(getattr(obj, '__serialize__', None)):
        dct = obj.__serialize__()
        module = obj.__module__
        if module == '__builtin__':
            module = None
        if isinstance(obj, type):
            name = obj.__name__
        else:
            name = obj.__class__.__name__
        type_name = u'.'.join(filter(None, [module, name]))
        if type_name == 'cropduster.resizing.Size':
            type_name = 'Size'
        dct.update({'__type__': type_name})
        return dct
    raise TypeError(type(obj).__name__ % "object of type %s is not JSON serializable")
dataset/ETHPy150Open theatlantic/django-cropduster/cropduster/utils/jsonutils.py/json_default/swapped operands of `%`