Serhiy Storchaka added the comment: There is nothing special with glob(). By default the ls command outputs sorted list of files, but os.listdir() doesn't. Python is just lower-level language than Posix shell. You always can call sort() on result.
It is easy to just add sort() after calling os.listdir() in current glob() implementation. It shouldn't significantly affect performance. I would support this feature. But I'm planning to implement glob() with os.scandir(), and it is not so easy to support sorting in that implementation. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21748> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com