Skip to content

Commit 77712d2

Browse files
committed
Further explain 'rest'.
1 parent 4b83c97 commit 77712d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/posixpath.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ def realpath(filename, *, strict=False):
423423
pardir = '..'
424424
getcwd = os.getcwd
425425

426-
# The stack of unresolved path parts.
426+
# The stack of unresolved path parts. When popped, a special value of None
427+
# indicates that a symlink target has been resolved, and that the original
428+
# symlink path can be retrieved by popping again. The [::-1] slice is a
429+
# very fast way of spelling list(reversed(...)).
427430
rest = filename.split(sep)[::-1]
428431

429432
# The resolved path, which is absolute throughout this function.

0 commit comments

Comments
 (0)