(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.  An empty last part will result in a path that
    ends with a separator.
Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.
Join two or more pathname components inserting / as needed . If any component is an absolute path all previous path components will be discarded . An empty last part will result in a path that ends with a separator .
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.  An empty last part will result in a path that
    ends with a separator."""
    a = os.fspath(a)
    sep = _get_sep(a)
    path = a
    try:
        if not p:
            path[:0] + sep  #23780: Ensure compatible data type even if p is null.
        for b in map(os.fspath, p):
            if b.startswith(sep):
                path = b
            elif not path or path.endswith(sep):
                path += b
            else:
                path += sep + b
    except (TypeError, AttributeError, BytesWarning):
        genericpath._check_arg_types('join', a, *p)
        raise
    return path
def join ( a , * p ) : a = os . fspath ( a ) sep = _get_sep ( a ) path = a try : if not p : path [ : 0 ] + sep #23780: Ensure compatible data type even if p is null. for b in map ( os . fspath , p ) : if b . startswith ( sep ) : path = b elif not path or path . endswith ( sep ) : path += b else : path += sep + b except ( TypeError , AttributeError , BytesWarning ) : genericpath . _check_arg_types ( 'join' , a , * p ) raise return path