[issue32040] Sorting pahtlib.Paths does give the same order as sorting the (string) filenames of that pathlib.Paths

R. David Murray report at bugs.python.org
Thu Nov 16 13:40:03 EST 2017


R. David Murray <rdmurray at bitdance.com> added the comment:

It is "obvious by inspection".  Paths are paths instead of strings because they are formed out of discrete path components instead of strings.  If you sorted each directory in the paths from the top down, and then sorted the subdirectories, and then sorted the filenames, you get that sorting by component.  It's the same order you would get out of an ls -R.

----------
nosy: +r.david.murray
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32040>
_______________________________________


More information about the Python-bugs-list mailing list