[issue7006] The replacement suggested for callable(x) in py3k is not equivalent

Nick Coghlan report at bugs.python.org
Sat Oct 3 07:12:34 CEST 2009


Nick Coghlan <ncoghlan at gmail.com> added the comment:

hasattr(type(x), "__call__") is technically a more valid replacement due
to the usual matter of metaclass confusion.

(Although putting special methods on instance objects is a recipe for
trouble in more ways than just this one).

----------
nosy: +ncoghlan

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7006>
_______________________________________


More information about the Python-bugs-list mailing list