X Tutup
The Wayback Machine - https://web.archive.org/web/20221223134622/https://github.com/python/cpython/pull/17911
Skip to content
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

gh-83448: Fix dict's __missing__ documentation #17911

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bharel
Copy link
Contributor

@bharel bharel commented Jan 9, 2020

According to the mailing list discussion, fixed dict's documentation to account for get() not calling __missing__ and moved __missing__ from the data model to dict as it's a dict-only method and not part of the Mapping ABC.

@bharel
Copy link
Contributor Author

bharel commented Feb 21, 2020

bump

@csabella csabella requested a review from terryjreedy May 23, 2020
Copy link
Member

@terryjreedy terryjreedy left a comment

My first thought is that the entry should stay where it is, though something may need to be added somewhere. Special method should not have to be part of an ABC to be documented in the special methods doc. This section long predated ABCs. I will have to look at the linked discussion when I have more time. So I don't know what change, if any, to suggest at the moment.

@bharel
Copy link
Contributor Author

bharel commented May 24, 2020

Special method should not have to be part of an ABC to be documented in the special methods doc.

Thing is, I'm not implying any opinion on whether it should be there or not.
What I I'm saying, is that it should be consistent.

At the moment, you have __reduce__ in pickle's docs, __subclasshook__ in abc's docs, and other dunders at their appropriate or relevant places. You don't have all dunders in the same location, apart from those relevant to all objects and classes.

Continuing with that logic, __missing__ should probably be in dict's docs, as that's the only location where it's relevant. Otherwise the documentation is inconsistent.

Furthermore - it's specifically dict.__missing__, not object.__missing__. The docs are misleading in the current state. (Discussion @ mailing list)

As a side note, the PR changes dict.get documentation as well.

@AlexWaygood AlexWaygood changed the title bpo-39267: Fix dict's __missing__ documentation gh-83448: Fix dict's __missing__ documentation Oct 30, 2022
@slateny
Copy link
Contributor

slateny commented Dec 10, 2022

Per Guido on the mailing list, maybe @rhettinger can suggest something (seeing that you reviewed/merged #17910 as well).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants
X Tutup