Message334122
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". |
|
Date |
User |
Action |
Args |
2019-01-21 10:48:35 | jdemeyer | set | recipients:
+ jdemeyer, ronaldoussoren, ncoghlan, vstinner, serhiy.storchaka, remi.lapeyre, AVINASH MISHRA |
2019-01-21 10:48:34 | jdemeyer | set | messageid: <1548067714.77.0.445921593222.issue35707@roundup.psfhosted.org> |
2019-01-21 10:48:34 | jdemeyer | link | issue35707 messages |
2019-01-21 10:48:34 | jdemeyer | create | |
|