> I have seen in PEP 3100 that callable() function is planned to be > removed in Python 3000 with this replacement: "just call the object > and catch the exception???". For one, the object (if it is > callable) can raise exception itself, so you need to somehow to > differentiate between exception raised inside its __call__ and > exception raised if object is not callable to begin with. I seem to recall bringing up the same issue a while ago; at the time, the answer was that if you need it, you can write your own: def callable(x): return hasattr(x, '__call__') My own preference would be for such queries to be defined abstractly as a built-in part of the language, but apparently my preference is out of sync with the community in this particular respect.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4