Split url urlsplit style, but return path as a list and query as a dict

def url_to_parts(url):
    """ Split url urlsplit style, but return path as a list and query as a dict """

    if not url:
        return None

    scheme, netloc, path, query, fragment = _urlsplit(url)

    if not path or path == '/':
        path = []
    else:
        path = path.strip('/').split('/')

    if not query:
        query = {}
    else:
        query = _parse_qs(query)

    return _urllib_parse.SplitResult(scheme, netloc, path, query, fragment)