Glossary
Callable
Python callables and their definition
Python Callable refers to objects that are able to be called. We know to not use a word in its own definition, so letβs dive deeper.
A callable is either a class with a __call__ method, or else a function. When you call a function or class, you are telling python to execute this piece of code.
Youβll most commonly be able to tell which items are callables because of the () at the end of their name. Ex: pd.DataFrame.max()
. In this case, .max()
is the callable since it is a function being called on the Pandas Dataframe.
Fun fact: Callable is also a python keyword. callable(your_item)
will return True
if your_item
is able to be called
Letβs take a look at a python callable code sample.