Message232281
I agree that the patch is not acceptable as is. The public attribute *defaultdict* should be explicitly documented as it is now, so that it is indexed. On the other hand, users should not directly call .__missing__, and it is not normal to document the private special method implementation of classes. For example, a collections.Counter returns 0 for missing keys but the doc makes no mention of .__missing__ as the implementation. It simply describe how a counter works.
John is correct that people writing other subclasses with __missing__ should usually subclass dict. This might be clearer if that special method were properly documented and indexed. I opened #23006 for this. |
|
Date |
User |
Action |
Args |
2014-12-07 21:02:30 | terry.reedy | set | recipients:
+ terry.reedy, rhettinger, ezio.melotti, r.david.murray, jjposner, docs@python, ethan.furman |
2014-12-07 21:02:30 | terry.reedy | set | messageid: <1417986150.74.0.497588278431.issue9536@psf.upfronthosting.co.za> |
2014-12-07 21:02:30 | terry.reedy | link | issue9536 messages |
2014-12-07 21:02:30 | terry.reedy | create | |
|