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 vstinner
Recipients eric.araujo, flox, pitrou, vstinner
Date 2011-10-24.21:44:57
SpamBayes Score 0.0010533959
Marked as misclassified No
Message-id <1319492698.23.0.640994259296.issue13258@psf.upfronthosting.co.za>
In-reply-to
Content
callable() is not just faster, it's also "more correct": hasattr(obj, "__call__") doesn't call base classes. See callable() of the six module:


def callable(obj):
  return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)
History
Date User Action Args
2011-10-24 21:44:58vstinnersetrecipients: + vstinner, pitrou, eric.araujo, flox
2011-10-24 21:44:58vstinnersetmessageid: <1319492698.23.0.640994259296.issue13258@psf.upfronthosting.co.za>
2011-10-24 21:44:57vstinnerlinkissue13258 messages
2011-10-24 21:44:57vstinnercreate