On this page
builtins.callable
Prev: builtins.BytesWarning | Up: builtins | Next: builtins.ChildProcessError
Rel: builtins.abs, builtins.aiter, builtins.all, builtins.anext
Ref: docs.python.org — builtins.callable
Tags: #public #python3 #stdlib #builtins
Import
import builtins
from builtins import callable
Signature & Overview
builtins.callable(obj, /)
Return whether the object is callable (i.e., some kind of function).
Usage
assert callable(len) is True
assert callable(42) is False
Gotchas
- Classes are callable too:
callable(MyClass)isTrue(instantiation), and a callable object may still fail when called with wrong arguments.
REPL Inspect
from builtins import callable
help(callable)
Linked from
Related notes
- tuts/python3/stdlib_module/builtins/BytesWarning Linked here; links to this page; shared tags: #builtins, #stdlib
- tuts/python3/stdlib_module/builtins/ChildProcessError Linked here; links to this page; shared tags: #builtins, #stdlib
- tuts/python3/stdlib_module/builtins Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/builtins/abs Linked here; shared tags: #builtins, #stdlib
- tuts/python3/stdlib_module/builtins/aiter Linked here; shared tags: #builtins, #stdlib
- tuts/python3/stdlib_module/builtins/all Linked here; shared tags: #builtins, #stdlib
- tuts/python3/stdlib_module/builtins/anext Linked here; shared tags: #builtins, #stdlib
- tuts/python3/stdlib_module/builtins/any shared tags: #builtins, #stdlib
- tuts/python3/stdlib_module/builtins/ArithmeticError shared tags: #builtins, #stdlib
- tuts/python3/stdlib_module/builtins/ascii shared tags: #builtins, #stdlib