Higher-Order Functions

A very important feature of the functional programming paradigm is higher-order functions. These are functions that accept functions as arguments or return functions as results. Python offers several kinds of higher-order functions. We'll look at them and some logical extensions.

As we can see, there are three varieties of higher-order functions as follows:

  • Functions that accept functions as one (or more) of their arguments
  • Functions that return a function
  • Functions that accept a function and return a function, a combination of the preceding two features

Python offers several higher-order functions of the first variety. We'll look at these built-in higher-order functions in this chapter. We'll look at a few of the ...

Get Functional Python Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.