消息 [381639]
I think operator.index() should be brought to be inline with PyNumber_Index():
- If the argument is a subclass of int then return it.
- Otherwise call type(obj).__index__(obj)
- If not an int, raise TypeError
- If not a direct int, raise a DeprecationWarning
The language reference for __index__() suggests this is the direction to go (https://docs.python.org/3/reference/datamodel.html#object.__index__). |
|
| 日期 |
用户 |
动作 |
参数 |
| 2020-11-23 02:06:51 | brett.cannon | 修改 | recipients:
+ brett.cannon, barry, rhettinger, mark.dickinson, ncoghlan, vstinner, Arfrever, alex, docs@python, ethan.furman, python-dev, eric.snow, serhiy.storchaka, mjacob |
| 2020-11-23 02:06:51 | brett.cannon | 修改 | messageid: <1606097211.07.0.209286271303.issue17576@roundup.psfhosted.org> |
| 2020-11-23 02:06:51 | brett.cannon | 链接 | issue17576 messages |
| 2020-11-23 02:06:50 | brett.cannon | 创建 | |
|