From the course: Functional Programming with Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

First-class functions

First-class functions - Python Tutorial

From the course: Functional Programming with Python

Start my 1-month free trial

First-class functions

- [Instructor] The third major concept of functional programming is something called First-Class Functions, and this is where things really start to get interesting and where the power and flexibility of functional programming really start to shine through. So what exactly do we mean when we talk about First-Class Functions? Well, in object-oriented programming, we generally treat data and functions as entirely different types of entities. We would never think of for example creating a list of functions or passing functions as arguments to other functions, or even stranger returning functions from other functions. However, in functional programming, it's not only possible to do these things, it's in fact a source of tremendous flexibility, and this is exactly what we mean when we say that a language supports First-Class Functions. It allows us to treat functions in a very similar way to how we normally treat other values…

Contents