(a, *p)
return path
Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.
Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.
Join two or more pathname components inserting / as needed . If any component is an absolute path all previous path components will be discarded .
def join(a, *p):
    """Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded."""
    sep = _get_sep(a)
    path = a
    for b in p:
        if b.startswith(sep):
            path = b
        elif not path or path.endswith(sep):
            path +=  b
        else:
            path += sep + b
    return path
def join ( a , * p ) : sep = _get_sep ( a ) path = a for b in p : if b . startswith ( sep ) : path = b elif not path or path . endswith ( sep ) : path += b else : path += sep + b return path