Message241665
To be consistent you'd have to do the attribute check in PyObject_Call as well, i.e. if an object isn't callable, then trying to call it should raise a TypeError. I think the cost can be mitigated by only checking heap types (i.e. tp_flags & Py_TPFLAGS_HEAPTYPE).
It would be cleaner if slot_tp_call failed by raising TypeError instead of letting the AttributeError bubble up. There's a precedent in slot_tp_iter to raise a TypeError if lookup_method() fails. This would avoid having to change PyObject_Call. |
|
Date |
User |
Action |
Args |
2015-04-20 15:50:47 | eryksun | set | recipients:
+ eryksun, rhettinger, terry.reedy, belopolsky, christian.heimes, ionelmc, steven.daprano, r.david.murray, Claudiu.Popa, ethan.furman, eric.snow, llllllllll, jedwards |
2015-04-20 15:50:47 | eryksun | set | messageid: <1429545047.44.0.932396647375.issue23990@psf.upfronthosting.co.za> |
2015-04-20 15:50:47 | eryksun | link | issue23990 messages |
2015-04-20 15:50:47 | eryksun | create | |
|