| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
bump |
Sorry, something went wrong.
There was a problem hiding this 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.
Sorry, something went wrong.
Thing is, I'm not implying any opinion on whether it should be there or not. 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. |
Sorry, something went wrong.
|
Per Guido on the mailing list, maybe @rhettinger can suggest something (seeing that you reviewed/merged #17910 as well). |
Sorry, something went wrong.
|
|
||
| .. method:: __missing__(key) | ||
|
|
||
| Not implemented by default. Called by :class:`dict`\ .\ :meth:`__getitem__` |
There was a problem hiding this comment.
| Not implemented by default. Called by :class:`dict`\ .\ :meth:`__getitem__` | |
| Not implemented by default. Called by :meth:`dict.__getitem__` |
Sorry, something went wrong.
|
I agree about not moving the entry. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
Closing as stale, the requested changes have not been applied in six years. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.