Turn Messy Text into Structured Insights With AI. Join Greg Live:Β Dec 4th, 2024
Leverage
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.

Link to code

On this page

No Headings