Introduction to functools

Let's learn about the Python funtools module and how they can be cached.

Python comes with a fun module called functools. The functions inside functools are considered “higher-order” functions which can act on or return other functions. In this chapter, we will be looking at the following portions of the functools package:

  • lru_cache
  • partials
  • singledispatch
  • wraps

Get hands-on with 1200+ tech skills courses.