New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>: Currently 2to3 converts `operator.isCallable(obj)` to `hasattr(obj, '__call__')`. This looks cumbersome, and can be deceived by instance attribute __call__. The more correct way is to use `isinstance(obj, collections.abc.Callable)`. Starting from Python 3.2 it can use the callable() builtin.
---------- components: 2to3 (2.x to 3.x conversion tool) messages: 306346 nosy: benjamin.peterson, levkivskyi, serhiy.storchaka priority: normal severity: normal status: open title: 2to3 fix for operator.isCallable() type: enhancement versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32046> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com