This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:51christian.heimessetrecipients: + christian.heimes, ionelmc, Claudiu.Popa
2015-04-17 19:30:51christian.heimessetmessageid: <1429299051.58.0.203403309194.issue23990@psf.upfronthosting.co.za>
2015-04-17 19:30:51christian.heimeslinkissue23990 messages
2015-04-17 19:30:51christian.heimescreate