I was studying introspection in Python, and as I was getting through basic examples, I found out that the callable
built-in function is no longer available in Python 3.1.
How can I check if a method is callable now?
Thank you
The callable() builtin function from Py2.x was resurrected in python3.2.
if hasattr(f, "__call__"):
What's New In Python 3.0
isinstance(f, collections.Callable)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With