diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-11-27 22:00:11 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-11-27 22:00:11 (GMT) |
commit | e71362d3dee9de626abb7d2d564550b5e59a1151 (patch) | |
tree | 1703c0a9f8d209b9dbff568a20f49a3541185dde /Doc/library | |
parent | dc9b17d922ba30cbfbcc767dfb0738b6bf66015d (diff) | |
download | cpython-e71362d3dee9de626abb7d2d564550b5e59a1151.zip cpython-e71362d3dee9de626abb7d2d564550b5e59a1151.tar.gz cpython-e71362d3dee9de626abb7d2d564550b5e59a1151.tar.bz2 |
Issue #10518: Bring back the callable() builtin.
Approved by Guido (BDFL) and Georg (RM).
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/functions.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 1c3ee12..34d583a 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -121,6 +121,19 @@ are always available. They are listed here in alphabetical order. Bytes objects can also be created with literals, see :ref:`strings`. +.. function:: callable(object) + + Return :const:`True` if the *object* argument appears callable, + :const:`False` if not. If this returns true, it is still possible that a + call fails, but if it is false, calling *object* will never succeed. + Note that classes are callable (calling a class returns a new instance); + instances are callable if their class has a :meth:`__call__` method. + + .. versionadded:: 3.2 + This function was first removed in Python 3.0 and then brought back + in Python 3.2. + + .. function:: chr(i) Return the string representing a character whose Unicode codepoint is the integer |