[issue23990] Callable builtin doesn't respect descriptors

Ethan Furman report at bugs.python.org
Sat Apr 18 03:19:22 CEST 2015


Ethan Furman added the comment:

The purpose of callable is to report whether an instance is callable or not, and that information is available on the instance's class, via the presence of __call__.  It is not up to callable() nor iter() nor ... to figure out that, even though the special method __call__ or __iter__ or ... exist, the object isn't /really/ what it says it is.

If you have special needs then write special functions, and they can be imported and used instead of the regular built-in ones.

----------
type: behavior -> enhancement
versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

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


More information about the Python-bugs-list mailing list