Message241354
| Author |
christian.heimes |
| Recipients |
Claudiu.Popa, christian.heimes, ionelmc |
| Date |
2015年04月17日.19:30:51 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1429299051.58.0.203403309194.issue23990@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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__') |
|
History
|
|---|
| 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 |
|