-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
docs: be clearer that glob results are unordered #140184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
.. note:: | ||
The pathnames are returned in no particular order. If you need a specific | ||
order, sort the results. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's already "although results are returned in arbitrary order" in the paragraph above. Can you remove that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it’s ok to repeat the point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already repeated twice:
"although results are returned in arbitrary order." (9f3c094)
"Whether or not the results are sorted depends on the file system." (52465e1)
The note
directive is used to highlight non-obvious details that may require additional attention from the user. If you think this is the case, then this directive should also be used for os.listdir()
and os,scandir()
.
.. note:: | ||
The pathnames are returned in no particular order. If you need a specific | ||
order, sort the results. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it’s ok to repeat the point.
Please don’t. Docs already say order is file system dependent. Brevity is inherently valuable. |
From this dpo discussion: https://discuss.python.org/t/should-glob-glob-output-be-stable/104385
📚 Documentation preview 📚: https://cpython-previews--140184.org.readthedocs.build/