[issue28296] Add __le__ and __ge__ to collections.Counter

Manuel Krebber report at bugs.python.org
Wed Sep 28 05:14:43 EDT 2016


New submission from Manuel Krebber:

I would really like there to be comparison operators for collection.Counter similar to the ones for sets. While you can now use minus to some degree for that comparison, it is very inefficient. I have attached an implementation of __ge__ and __le__ as a patch. I could also provide the necessary additions to the documentation, if that is desired.

----------
components: Library (Lib)
files: counter_comparison.patch
keywords: patch
messages: 277597
nosy: Wheerd
priority: normal
severity: normal
status: open
title: Add __le__ and __ge__ to collections.Counter
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44858/counter_comparison.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28296>
_______________________________________


More information about the Python-bugs-list mailing list