Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:
Thanks for the report, but there isn't anything that can be done about this. The core design concept for Counter was to be a regular dictionary augmented by a few capabilities that made it suitable for counting. It isn't closed-off in any way. On the plus side, that makes it versatile and make it fit well the other parts of the Python ecosystem that work with dictionaries. On the minus, there is nothing to keep out data that doesn't make sense in the context of counting. FWIW, there is a multiset package on PyPi that offers a closed-off implementation that has an internal dictionary that can only be accessed by methods that prevent negative counts or non-integer values. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43062> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com