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.
functools: an example
functools.partial(pow, exp=2) creates a new function that always squares its input.
Related terms
- functools.lru_cache
- functools.partial
- Higher-order function
- Decorator
More Python advanced terms
- functools.lru_cache
- functools.partial
- functools.wraps
- Future
- Generator
- Generator expression
- Generic
- Inheritance
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.