I am learning Python using Dive Into Python 3 book. I like it, but I don\'t understand the example used to introduce Closures in Section 6.5.
I mean, I see how it wo
here's an closure usage, of get configures:
def confmaker(): cf=ini_conf() def clo(*args): return cf.get(*args) return clo cfget=confmaker() cfget(...)
here ini_conf is called only once. In my understanding, closures avoid global variables(like cf), and make usage simple.