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

Trundle report at bugs.python.org
Sat Oct 3 12:25:31 CEST 2009


Trundle <andy-python at hammerhartes.de> added the comment:

As every type is an instance of `type`, every type also has a
`__call__` attribute which means ``hasattr(type(x), '__call__')`` is
always true. `callable()` checks whether `tp_call` is set on the type,
which cannot be done in Python directly.

----------
nosy: +Trundle

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


More information about the Python-bugs-list mailing list