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 rhettinger
Recipients docs@python, madphysicist, rhettinger
Date 2017-07-27.19:44:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501184653.06.0.83925182062.issue31042@psf.upfronthosting.co.za>
In-reply-to
Content
This seems like a generic issue for magic methods and is already covered by "for custom classes, implicit invocations of special methods are only guaranteed to work correctly if defined on an object’s type, not in the object’s instance dictionary."

While you're technically correct with suggesting "Equivalent to `type(a).__index__(a)`", I don't think this is an improvement.  It makes the docs safe against overly pedantic readings, but it also reduces the intelligibility for everyday users.

The usual approach in the docs is to say "a[b] <==> a.__getitem__(b)" rather than "a[b] <==> type(a).__getitem__(a, b)".  The latter is more correct but it is also less helpful.  For the most part, this style of presentation has worked well for a lot of people for a long time.

I recommend closing this or not doing any more than changing "Equivalent to:" to "Roughly equivalent to:".
History
Date User Action Args
2017-07-27 19:44:13rhettingersetrecipients: + rhettinger, docs@python, madphysicist
2017-07-27 19:44:13rhettingersetmessageid: <1501184653.06.0.83925182062.issue31042@psf.upfronthosting.co.za>
2017-07-27 19:44:13rhettingerlinkissue31042 messages
2017-07-27 19:44:12rhettingercreate