[issue39569] Is the return value of pathlib.Path.glob() sorted?

New submission from Björn Lindqvist <bjourne@gmail.com>: It would be great if the docs were clearer on what you can assume on the ordering of pathlib.Path.glob() calls. Is it sorted? Is it the same in consecutive calls? I'm guessing you can't assume anything at all, which I think should be clarified in the docs. ---------- assignee: docs@python components: Documentation messages: 361494 nosy: Björn.Lindqvist, docs@python priority: normal severity: normal status: open title: Is the return value of pathlib.Path.glob() sorted? type: enhancement versions: Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39569> _______________________________________

Karthikeyan Singaravelan <tir.karthi@gmail.com> added the comment: See also discussion at issue38764. I guess it's not sorted as per msg356356. ---------- nosy: +serhiy.storchaka, xtreak _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39569> _______________________________________

Brett Cannon <brett@python.org> added the comment: The problem is you would have to say the same thing for all functions that return a list or touch the file system. So it's typically better to just assume unsorted and you can't expect idempotent results when dealing with the OS. ---------- nosy: +brett.cannon _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue39569> _______________________________________
participants (3)
-
Björn Lindqvist
-
Brett Cannon
-
Karthikeyan Singaravelan