def diff(a, b, path=None):
    path = _make_path(path)
    if isinstance(a, (list, tuple)):
        return _diff_sequences(a, b, path)
    if (type(a).__name__ == 'SON'):
        a = dict(a)
    if (type(b).__name__ == 'SON'):
        b = dict(b)
    if isinstance(a, dict_type):
        return _diff_dicts(a, b, path)
    if (type(a).__name__ == 'ObjectId'):
        a = str(a)
    if (type(b).__name__ == 'ObjectId'):
        b = str(b)
    if (type(a).__name__ == 'Int64'):
        a = int(a)
    if (type(b).__name__ == 'Int64'):
        b = int(b)
    if (not isinstance(a, _SUPPORTED_TYPES)):
        raise NotImplementedError('Unsupported diff type: {0}'.format(type(a)))
    if (not isinstance(b, _SUPPORTED_TYPES)):
        raise NotImplementedError('Unsupported diff type: {0}'.format(type(b)))
    if (a != b):
        return [(path[:], a, b)]
    return []
def diff(a, b, path=None):
    path = _make_path(path)
    if isinstance(a, (list, tuple)):
        return _diff_sequences(a, b, path)
    if (type(a).__name__ == 'SON'):
        a = dict(a)
    if (type(b).__name__ == 'SON'):
        b = dict(b)
    if isinstance(a, dict_type):
        return _diff_dicts(a, b, path)
    if (type(a).__name__ == 'ObjectId'):
        a = str(a)
    if (type(b).__name__ == 'ObjectId'):
        b = str(b)
    if (type(a).__name__ == 'Int64'):
        a = int(a)
    if (type(b).__name__ == 'Int64'):
        b = int(b)
    if (not isinstance(a, _SUPPORTED_TYPES)):
        raise NotImplementedError('Unsupported diff type: {0}'.format(type(a)))
    if (not isinstance(b, _SUPPORTED_TYPES)):
        raise NotImplementedError('Unsupported diff type: {0}'.format(type(b)))
    if (a != b):
        return [(path[:], a, b)]
    return []