3 ms·
It's not a generator, but his intention is clear - mutable keyword arguments allow for some clever tricks.
by wahnfrieden 13y ago
It's not a generator, but his intention is clear - mutable keyword arguments allow for some clever tricks.
- deleted 13y ago[deleted]
- jzwinck 13y agoThey 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()