Vedran Čačić <ved...@gmail.com> added the comment:

As I said above, if we're going to go down that route, it seems much more 
reasonable to me that total should be a cached property, that's updated on 
every Counter update (in __setitem__, increased by a difference of a new value 
and an old one for that key).

And normalization should just provide a view over the Counter, that just passes 
the values through division with the above cached property. The view should of 
course be immutable by itself, but should reflect the changes of the underlying 
counter, just as already existing views (e.g. dict_values) do.

----------

_______________________________________
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