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.

作者 jdemeyer
收信人 AVINASH MISHRA, jdemeyer, ncoghlan, remi.lapeyre, ronaldoussoren, serhiy.storchaka, vstinner
日期 2019-01-21.10:48:34
SpamBayes Score -1.0
Marked as misclassified
Message-id <1548067714.77.0.445921593222.issue35707@roundup.psfhosted.org>
In-reply-to
内容
The motivation for PEP 357 was certainly using an object as the index for a sequence, but that's not the only use case.

In fact PEP 357 states "For example, the slot can be used any time Python requires an integer internally"

So despite the name __index__, I think that this is now the de facto standard for "convert the object (which is some kind of integer) to a Python int without loss of precision".
历史
日期 用户 动作 参数
2019-01-21 10:48:35jdemeyer修改recipients: + jdemeyer, ronaldoussoren, ncoghlan, vstinner, serhiy.storchaka, remi.lapeyre, AVINASH MISHRA
2019-01-21 10:48:34jdemeyer修改messageid: <1548067714.77.0.445921593222.issue35707@roundup.psfhosted.org>
2019-01-21 10:48:34jdemeyer链接issue35707 messages
2019-01-21 10:48:34jdemeyer创建