Commit 55c41438 by Steven Bird

decrement N in FreqDist.pop and FreqDist.popitem, remove arg from…

decrement N in FreqDist.pop and FreqDist.popitem, remove arg from FreqDist.popitem; resolves issue 726
parent 5edf189e
...@@ -467,12 +467,14 @@ class FreqDist(dict): ...@@ -467,12 +467,14 @@ class FreqDist(dict):
self.inc(sample, count=count) self.inc(sample, count=count)
def pop(self, other): def pop(self, other):
self._N -= 1
self._reset_caches() self._reset_caches()
return dict.pop(self, other) return dict.pop(self, other)
def popitem(self, other): def popitem(self):
self._N -= 1
self._reset_caches() self._reset_caches()
return dict.popitem(self, other) return dict.popitem(self)
def clear(self): def clear(self):
self._N = 0 self._N = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment