Mark Dickinson <dicki...@gmail.com> added the comment:

> total should be a cached property, that's updated on every Counter update

That would run into difficulties for Counters with float values: e.g., after

>>> c = Counter()
>>> c['spam'] = 1e100
>>> c['eggs'] = 1
>>> c['spam'] = 0

the  cached total would likely be 0.0, because that's what the sum of the 
(new-old) values gives:

>>> (1e100 - 0) + (1 - 0) + (0 - 1e100)
0.0

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue25478>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to