[issue21748] glob.glob does not sort its results

Dave Jones report at bugs.python.org
Thu Nov 12 17:22:40 EST 2015


Dave Jones added the comment:

>From the bash man-page: "... If one of these characters appears, then the word is regarded as a pattern, and replaced with an *alphabetically sorted* list of filenames matching the pattern".

I would agree that glob.glob shouldn't sort its results (the overhead may be substantial, and there are plenty of use-cases that don't require sorting), but given that the documented behaviour is at odds (implicitly via the shell's documentation) with the implemented behaviour I would argue that it is premature to close this without at least adding a note to the Python docs.

(P.S. in case my comment is received poorly, I'm not the original author of this ticket, and no aspersions should be cast upon drj for my possibly foolish views!)

----------
nosy: +Dave Jones

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21748>
_______________________________________


More information about the Python-bugs-list mailing list