AI engineering glossary · Python advanced

What is functools?

functools: A standard library module of tools for working with functions, including partial, lru_cache, reduce, wraps and singledispatch. It supports functional style and performance helpers without extra dependencies. It ships with Python, so no installation is needed.

Level: intermediateTopic: Python advanced

functools: an example

functools.partial(pow, exp=2) creates a new function that always squares its input.

Related terms

More Python advanced terms

Where you learn it

functools is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.