消息 [195513]
Couldn't you make use of inspect.getattr_static()?
getattr_static(obj.__class__, '__index__').__get__(obj)()
getattr_static() does some extra work to get do the right lookup. I haven't verified that it matches _PyType_Lookup() exactly, but it should be pretty close at least.
Also, pickle (unfortunately) also does lookup on instances rather than classes for the special methods (issue #16251). |
|
| 日期 |
用户 |
动作 |
参数 |
| 2013-08-17 19:49:09 | eric.snow | 修改 | recipients:
+ eric.snow, arigo, mark.dickinson, zach.ware, serhiy.storchaka |
| 2013-08-17 19:49:09 | eric.snow | 修改 | messageid: <1376768949.7.0.758056043899.issue18712@psf.upfronthosting.co.za> |
| 2013-08-17 19:49:09 | eric.snow | 链接 | issue18712 messages |
| 2013-08-17 19:49:09 | eric.snow | 创建 | |
|