How do nested functions work in Python?
You are basically creating a closure. In computer science, a closure is a first-class function with free variables that are bound in the lexical environment. Such a function is said to be “closed over” its free variables. Related reading: Closures: why are they so useful? A closure is simply a more convenient way to give … Read more