You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't need to filter the segments, we just need to check if *_rest is empty:
-start_list = [x for x in start_rest.split(sep) if x]-path_list = [x for x in path_rest.split(sep) if x]+start_list = start_rest.split(sep) if start_rest else []+path_list = path_rest.split(sep) if path_rest else []
We can use str.join() instead of os.path.join():
-return join(*rel_list)+return sep.join(rel_list)
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Activity
gh-117607: Speedup os.path.relpath() (GH-117608)
pythongh-117607: Speedup os.path.relpath() (pythonGH-117608)