消息 [195451]
Just mentioning it here again, but "type(a).__index__(a)" is still not perfectly correct. Attached is a case where it differs.
I think you get always the correct answer by evaluating "range(a).stop". It's admittedly obscure... For example:
class A:
def __index__(self):
return -42**100
a = A()
print(range(a).stop) |
|
| 日期 |
用户 |
动作 |
参数 |
| 2013-08-17 07:55:01 | arigo | 修改 | recipients:
+ arigo, mark.dickinson, zach.ware, serhiy.storchaka |
| 2013-08-17 07:55:01 | arigo | 修改 | messageid: <1376726101.58.0.364501057625.issue18712@psf.upfronthosting.co.za> |
| 2013-08-17 07:55:01 | arigo | 链接 | issue18712 messages |
| 2013-08-17 07:55:01 | arigo | 创建 | |
|