News for hackers. Stuff that matters.
Re:Things which aren't magic – Flask and app.route by ekimekim on Monday December 29, 2014 @03:58AM (#8809017)
As a followup to the sibling comment, note that closures aren't the only way to achieve the same effect, for example:

    class MyDecorator(object):
      def __init__(self, func):
        self.func = func
      def __call__(self, one, two, three):
        # do stuff
        return self.func(three, two, one)
ie. you can just as easily use a class instance to store your state, instead of a closure. I routinely use both methods, depending on which is more useful at the time.

There are no comments on this comment yet.