Loading video player…

Exploring Python Closures: Examples and Use Cases (Overview)

In Python, a closure is typically a function defined inside another function. This inner function grabs the objects defined in its enclosing scope and associates them with the inner function object itself. The resulting combination is called a closure.

Closures are a common feature in functional programming languages. In Python, closures can be pretty useful because they allow you to create function-based decorators, which are powerful tools.

In this video course, you’ll:

  • Learn what closures are and how they work in Python
  • Get to know common use cases of closures
  • Explore alternatives to closures
Download

Course Slides (.pdf)

2.2 MB
Download

Sample Code (.zip)

4.0 KB

Become a Member to join the conversation.