GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-110383: Add documentation entry for `sorted(d)` by shenanigansd · Pull Request #112777 · python/cpython

Conversation

@shenanigansd

@shenanigansd shenanigansd commented Dec 5, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Continues #110383
Originally reported in https://mail.python.org/archives/list/[email protected]/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.

  • Issue: Issues from [email protected] #110383

📚 Documentation preview 📚: https://cpython-previews--112777.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shenanigansd
Document sorted(d)
70b9acf
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news awaiting review labels Dec 5, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Dec 5, 2023
Issues from [email protected] #110383
Closed
@shenanigansd
Remove trailing space
5be14a8
@rhettinger

rhettinger commented Dec 16, 2023

Copy link
Copy Markdown
Contributor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rhettinger rhettinger closed this Dec 16, 2023
@shenanigansd
shenanigansd deleted the patch-1 branch December 16, 2023 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@shenanigansd @rhettinger
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.