News for hackers. Stuff that matters.
Re:Python: Common Newbie Mistakes, Part 1 by wahnfrieden on Saturday July 06, 2013 @06:35PM (#6000309)
It's not a generator, but his intention is clear - mutable keyword arguments allow for some clever tricks.
Re:Python: Common Newbie Mistakes, Part 1 by jzwinck on Saturday July 06, 2013 @10:41PM (#6000837)
They sure do--that's why we shouldn't have them. Instead:

  class Foo:
      def __init__(self):
          self.n = 0

      def __call__(self):
          self.n += 1
          return self.n

  foo = Foo()