def max_length(obj):
    """
    Return the maximum length of obj or any of its sublists, if obj is a list.
    otherwise return 0.

    @param object|list obj: object to return length of
    @rtype: int

    >>> max_length(17)
    0
    >>> max_length([1, 2, 3, 17])
    4
    >>> max_length([[1, 2, 3, 3], 4, [4, 5]])
    4
    """
    if obj == []:
        return 0
    elif isinstance(obj, list):
        res = 0
        for item in obj:
            if max_length(item) > res:
                res = max_length(item)
        if len(obj) > res:
            res = len(obj)
        return res
    else:
        return 0