消息 [144126]
Yes, that's intentional. When use of __int__ was deprecated, a bug report popped up from someone who wanted to be able to have their own objects treated as integers for the purposes of struct.pack. (I don't recall which issue; Meador, do you remember?) So we added use of __index__ at that point.
I think __index__ is the right interface for something to expose if it wants to be usable as an integer, and this usage is consistent with the original __index__ PEP. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2011-09-16 11:59:07 | mark.dickinson | 修改 | recipients:
+ mark.dickinson, skrah, meador.inge |
| 2011-09-16 11:59:07 | mark.dickinson | 修改 | messageid: <1316174347.72.0.567410783453.issue12974@psf.upfronthosting.co.za> |
| 2011-09-16 11:59:07 | mark.dickinson | 链接 | issue12974 messages |
| 2011-09-16 11:59:06 | mark.dickinson | 创建 | |
|