Christian Heimes added the comment:
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__')
----------
nosy: +christian.heimes
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23990>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com