| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Thank for you the suggestion but we should decline. Mostly, we try to avoid this kind of tight coupling of documentation between different parts of the language. Tools like sorted, reversed, and enumerate are ways that any iterable (or sequence) can be returned. There is nothing specific to dictionaries. If this comes up again, we could consider an FAQ entry or an addition to the looping idioms section of the tutorial, but this edit to the detailed spec for dicts is the wrong place to do it (and not at all discoverable by beginners). One other thought is that this hasn't come up before and the underlying report wasn't from a beginner; instead, it was an unsubstantiated suggestion that somewhere someone might someday have a moment of confusion. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Continues #110383
Originally reported in https://mail.python.org/archives/list/docs@python.org/thread/ZEDPZHRVGLYR4ZFZ5I3NBWVMHMX4WPGW/ (3rd list item)
Add a documentation entry for sorted(d) to clarify that it returns the sorted keys and not the dict itself.
📚 Documentation preview 📚: https://cpython-previews--112777.org.readthedocs.build/