This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients docs@python, terry.reedy
Date 2014-12-07.20:49:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417985369.96.0.326358204226.issue23006@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, the only index entry for __missing__ is  "__missing__() (collections.defaultdict method)".  This entry should probably not exist -- see #9536, which inspired this issue.  The method is not mentioned in the special-methods doc, and the explanation in the dict doc is not indexed.  Two suggestions:

https://docs.python.org/3/reference/datamodel.html#emulating-container-types

After __getitem__ entry, add automatically indexed entry, something like 

object.__missing__(self, key):
   When present in a dict subclass, called by dict.__getitem__ for missing keys.

https://docs.python.org/3/library/stdtypes.html#mapping-types-dict

Before the d[key] paragraph starting "If a subclass of dict defines a method __missing__()" add explicit __missing__ index directive.  The last sentence of the paragraph

"See collections.Counter for a complete implementation including other methods helpful for accumulating and managing tallies."

is confusing because the linked entry makes no mention of __missing__ (as it should not).  Change sentence to something like

"There are two stdlib dict subclasses that use (different) __missing__ methods as part of their implementation: collections.Counter and collections.defaultdict."

I will work on a patch and try to get the markup correct.
History
Date User Action Args
2014-12-07 20:49:30terry.reedysetrecipients: + terry.reedy, docs@python
2014-12-07 20:49:29terry.reedysetmessageid: <1417985369.96.0.326358204226.issue23006@psf.upfronthosting.co.za>
2014-12-07 20:49:29terry.reedylinkissue23006 messages
2014-12-07 20:49:29terry.reedycreate