Message241354
callable() just checks that an object can be called. It doesn't check if the actual call or even the access to the __call__() member succeeds. Magic methods are resolved on the class or type of an object, not the object itself. Therefore the descriptor protocol is not invoked unless you do the actual call.
The check roughly translated to:
def callable(obj):
return hasattr(type(obj), '__call__') |
|
Date |
User |
Action |
Args |
2015-04-17 19:30:51 | christian.heimes | set | recipients:
+ christian.heimes, ionelmc, Claudiu.Popa |
2015-04-17 19:30:51 | christian.heimes | set | messageid: <1429299051.58.0.203403309194.issue23990@psf.upfronthosting.co.za> |
2015-04-17 19:30:51 | christian.heimes | link | issue23990 messages |
2015-04-17 19:30:51 | christian.heimes | create | |
|